From d9730fc93b61c864fb73fae887a2d9bd102f0221 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 13 Mar 2025 15:42:17 +0100 Subject: [PATCH] Fix fd check --- src/libutil/logging.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index c3ccfba42..8ef7a3612 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -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) throw SysError("opening log file '%1%'", path);