Do not close stdout and stderr

pull/2107/head
Tatsuhiro Tsujikawa 2023-09-18 17:13:09 +09:00
parent f05deb0cb2
commit 5047e4a4ab
1 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,9 @@ int BufferedFile::onClose()
#else // __MINGW32__
_commit(fileno(fp_));
#endif // __MINGW32__
rv = fclose(fp_);
if (fp_ != stdin && fp_ != stderr) {
rv = fclose(fp_);
}
fp_ = nullptr;
}
return rv;