1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 19:03:16 +02:00

Fix fd check

This commit is contained in:
Eelco Dolstra 2025-03-13 15:42:17 +01:00
parent 1efccf34b1
commit d9730fc93b

View file

@ -296,7 +296,7 @@ Logger * makeJSONLogger(const std::filesystem::path & path, bool includeNixPrefi
{ } { }
}; };
auto fd{toDescriptor(open(path.c_str(), O_CREAT | O_APPEND | O_WRONLY, 0644))}; AutoCloseFD fd{toDescriptor(open(path.c_str(), O_CREAT | O_APPEND | O_WRONLY, 0644))};
if (!fd) if (!fd)
throw SysError("opening log file '%1%'", path); throw SysError("opening log file '%1%'", path);