Avoid closing stdin/stdout/stderr standard streams

This commit is contained in:
Rangi committed 2026-07-13 13:02:46 -04:00
1 parent 8ab6190f96
commit e9fa1e4e94
11 files changed
+42 -22

No files matched your search

+1 -5
View File
@@ -405,11 +405,7 @@ void LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
if (fd >= 0) {
// If the file is stdin, or if measuring its size failed, read it in pieces
Defer closeFile{[&] {
if (fd != STDIN_FILENO) {
close(fd);
}
}};
Defer closeFile{[&] { xclose(fd); }};
// Reasonably large buffer size for `read` performance
char buf[8192];