summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2009-04-08 20:06:34 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2009-04-08 20:06:34 +0300
commit2ac7316d991eec35011eaa0c6fa058c79f38bacc (patch)
treef8e7980c4ddad3e03c0757bfe0e6a2bf6ede4863 /libgfortran/io
parent557cc596c9084fc279b1cb2f1aa77c0d55f6aafe (diff)
downloadgcc-2ac7316d991eec35011eaa0c6fa058c79f38bacc.tar.gz
open.c (already_open): Test for POSIX close return value.
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. From-SVN: r145761
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/open.c2
-rw-r--r--libgfortran/io/unit.c2
-rw-r--r--libgfortran/io/unix.c2
3 files changed, 3 insertions, 3 deletions
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;
}