diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-11-10 21:46:25 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-11-10 21:46:53 +0100 |
commit | 6893c896561387fa88f610a2f54ba59867021cd8 (patch) | |
tree | 0965f6496e5373b7412493322e2e53a1dc1d5b4b /lib | |
parent | 2ad1eb5296daea031aa0765caeb86f25c527120a (diff) |
fs: do not close stdio streams when gc'ing scope
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fs.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -710,7 +710,10 @@ static void close_proc(void *ud) { } static void close_file(void *ud) { - fclose((FILE *)ud); + FILE *fp = ud; + + if (fp != stdin && fp != stdout && fp != stderr) + fclose(fp); } static void close_dir(void *ud) { |