Merge pull request #5683 from edolstra/nix-develop-cloexec

createTempFile(): Mark file as CLOEEXEC
This commit is contained in:
Eelco Dolstra
2021-11-29 12:35:18 +01:00
committed by GitHub
+1
View File
@@ -512,6 +512,7 @@ std::pair<AutoCloseFD, Path> createTempFile(const Path & prefix)
AutoCloseFD fd(mkstemp((char *) tmpl.c_str()));
if (!fd)
throw SysError("creating temporary file '%s'", tmpl);
closeOnExec(fd.get());
return {std::move(fd), tmpl};
}