diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-06 06:54:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-06 06:54:26 -0700 |
commit | c7ee3d76f654e591e3a18f4c2de360cddf06e531 (patch) | |
tree | d3497a228a1b816dc115e86a9a8c7290fc330abd | |
parent | 5dc838da3e89ed56665b8c13d1871a802aeea68e (diff) | |
download | txr-c7ee3d76f654e591e3a18f4c2de360cddf06e531.tar.gz txr-c7ee3d76f654e591e3a18f4c2de360cddf06e531.tar.bz2 txr-c7ee3d76f654e591e3a18f4c2de360cddf06e531.zip |
streams: do not close stderr.
* stream.c (stdio_close): Recognize stderr, not only stdin and
stdout, as one of the streams not to be closed. This fixes
situations when stderr is closed and exception handling tries
to use it.
-rw-r--r-- | stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -973,7 +973,7 @@ static val stdio_close(val stream, val throw_on_error) { struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle); - if (h->f != 0 && h->f != stdin && h->f != stdout) { + if (h->f != 0 && h->f != stdin && h->f != stdout && h->f != stderr) { int result = fclose(h->f); h->f = 0; if (result == EOF && throw_on_error) { |