mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-04 03:05:36 +00:00
Avoid closing stdin/stdout/stderr standard streams
This commit is contained in:
1 parent
8ab6190f96
commit
e9fa1e4e94
11 files changed
+42
-22
No files matched your search
+2
-1
@@ -19,6 +19,7 @@
|
||||
#include "helpers.hpp"
|
||||
#include "linkdefs.hpp"
|
||||
#include "platform.hpp"
|
||||
#include "util.hpp" // xfclose
|
||||
#include "verbosity.hpp"
|
||||
#include "version.hpp"
|
||||
|
||||
@@ -446,7 +447,7 @@ void obj_ReadFile(std::string const &filePath, size_t fileID) {
|
||||
if (!file) {
|
||||
fatal("Failed to open file \"%s\": %s", fileName, strerror(errno));
|
||||
}
|
||||
Defer closeFile{[&] { fclose(file); }};
|
||||
Defer closeFile{[&] { xfclose(file); }};
|
||||
|
||||
// First, check if the object is a RGBDS object, a SDCC one, or neither.
|
||||
// A single `ungetc` is guaranteed to work.
|
||||
|
||||
Reference in new issue
Block a user