summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-08 17:06:34 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-08 17:06:34 +0000
commit6ffeb312e8347beba63d9a9cc30509ca7f2469bb (patch)
treef8e7980c4ddad3e03c0757bfe0e6a2bf6ede4863 /libgfortran
parentb5e8a0bc023805f53f86c4f6807b14444167b302 (diff)
downloadgcc-6ffeb312e8347beba63d9a9cc30509ca7f2469bb.tar.gz
2009-04-08 Janne Blomqvist <jb@gcc.gnu.org>
* io/open.c (already_open): Test for POSIX close return value. * io/unit.c (close_unit_1): Likewise. * io/unix.c (raw_close): Return 0 for success for preconnected units. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145761 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/open.c2
-rw-r--r--libgfortran/io/unit.c2
-rw-r--r--libgfortran/io/unix.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 8bc904acba6..49b00c7bf85 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,11 @@
2009-04-08 Janne Blomqvist <jb@gcc.gnu.org>
+ * io/open.c (already_open): Test for POSIX close return value.
+ * io/unit.c (close_unit_1): Likewise.
+ * io/unix.c (raw_close): Return 0 for success for preconnected units.
+
+2009-04-08 Janne Blomqvist <jb@gcc.gnu.org>
+
* runtime/string.c (compare0): Use gfc_charlen_type.
* runtime/error.c (gfc_itoa): Move to io/write.c
(xtoa): Rename to gfc_xtoa.
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index 7caa1c9ffdc..e3709f72333 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -682,7 +682,7 @@ already_open (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
}
#endif
- if (sclose (u->s) == FAILURE)
+ if (sclose (u->s) == -1)
{
unlock_unit (u);
generate_error (&opp->common, LIBERROR_OS,
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index 4c460166152..00bea5a9b61 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -626,7 +626,7 @@ close_unit_1 (gfc_unit *u, int locked)
if (u->previous_nonadvancing_write)
finish_last_advance_record (u);
- rc = (u->s == NULL) ? 0 : sclose (u->s) == FAILURE;
+ rc = (u->s == NULL) ? 0 : sclose (u->s) == -1;
u->closed = 1;
if (!locked)
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 4f8cbb535c4..2fe73bbff1b 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -349,7 +349,7 @@ raw_close (unix_stream * s)
&& s->fd != STDIN_FILENO)
retval = close (s->fd);
else
- retval = SUCCESS;
+ retval = 0;
free_mem (s);
return retval;
}