Commit 2ac7316d by Janne Blomqvist

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
parent 557cc596
2009-04-08 Janne Blomqvist <jb@gcc.gnu.org> 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/string.c (compare0): Use gfc_charlen_type.
* runtime/error.c (gfc_itoa): Move to io/write.c * runtime/error.c (gfc_itoa): Move to io/write.c
(xtoa): Rename to gfc_xtoa. (xtoa): Rename to gfc_xtoa.
......
...@@ -682,7 +682,7 @@ already_open (st_parameter_open *opp, gfc_unit * u, unit_flags * flags) ...@@ -682,7 +682,7 @@ already_open (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
} }
#endif #endif
if (sclose (u->s) == FAILURE) if (sclose (u->s) == -1)
{ {
unlock_unit (u); unlock_unit (u);
generate_error (&opp->common, LIBERROR_OS, generate_error (&opp->common, LIBERROR_OS,
......
...@@ -626,7 +626,7 @@ close_unit_1 (gfc_unit *u, int locked) ...@@ -626,7 +626,7 @@ close_unit_1 (gfc_unit *u, int locked)
if (u->previous_nonadvancing_write) if (u->previous_nonadvancing_write)
finish_last_advance_record (u); 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; u->closed = 1;
if (!locked) if (!locked)
......
...@@ -349,7 +349,7 @@ raw_close (unix_stream * s) ...@@ -349,7 +349,7 @@ raw_close (unix_stream * s)
&& s->fd != STDIN_FILENO) && s->fd != STDIN_FILENO)
retval = close (s->fd); retval = close (s->fd);
else else
retval = SUCCESS; retval = 0;
free_mem (s); free_mem (s);
return retval; return retval;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment