Files
semi-libc/src/stdio
Rich Felker 426a0e2912 fix fclose of permanent (stdin/out/err) streams
this fixes a bug reported by Nuno Gonçalves. previously, calling
fclose on stdin or stdout resulted in deadlock at exit time, since
__stdio_exit attempts to lock these streams to flush/seek them, and
has no easy way of knowing that they were closed.

conceptually, leaving a FILE stream locked on fclose is valid since,
in the abstract machine, it ceases to exist. but to satisfy the
implementation-internal assumption in __stdio_exit that it can access
these streams unconditionally, we need to unlock them.

it's also necessary that fclose leaves permanent streams in a state
where __stdio_exit will not attempt any further operations on them.
fortunately, the call to fflush already yields this property.
2015-09-09 04:31:07 +00:00
..
2011-02-12 00:22:29 -05:00
2012-11-08 16:39:41 -05:00
2011-02-20 17:19:37 -05:00
2011-02-12 00:22:29 -05:00
2012-10-27 19:52:40 -04:00
2012-11-08 16:39:41 -05:00
2015-06-13 20:53:02 +00:00
2012-10-27 19:52:40 -04:00
2012-11-08 16:39:41 -05:00
2011-02-12 00:22:29 -05:00
2013-04-05 23:20:28 -07:00
2012-10-27 19:52:40 -04:00
2011-02-12 00:22:29 -05:00
2012-11-08 16:39:41 -05:00
2012-11-08 16:39:41 -05:00
2012-11-08 16:39:41 -05:00
2012-11-08 16:39:41 -05:00
2012-06-20 09:27:28 -04:00
2012-10-27 19:52:40 -04:00
2011-02-12 00:22:29 -05:00
2012-11-08 16:39:41 -05:00
2012-11-08 16:39:41 -05:00
2013-04-05 23:20:28 -07:00
2013-04-05 23:20:28 -07:00
2014-06-04 03:39:22 -04:00
2013-04-05 23:20:28 -07:00
2012-11-08 16:39:41 -05:00
2013-04-05 23:20:28 -07:00
2012-11-08 16:39:41 -05:00
2013-04-05 23:20:28 -07:00
2013-04-05 23:20:28 -07:00
2013-04-05 23:20:28 -07:00