diff --git a/src/libutil/unix/file-system.cc b/src/libutil/unix/file-system.cc index 8ff66328b..77b83858f 100644 --- a/src/libutil/unix/file-system.cc +++ b/src/libutil/unix/file-system.cc @@ -16,7 +16,7 @@ namespace nix { Descriptor openDirectory(const std::filesystem::path & path) { - return open(path.c_str(), O_RDONLY | O_DIRECTORY); + return open(path.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC); } void setWriteTime(