mirror of
https://github.com/NixOS/nix
synced 2025-06-29 10:31:15 +02:00
Use O_CLOEXEC in most places
This commit is contained in:
parent
9bdd949cfd
commit
202683a4fc
9 changed files with 23 additions and 19 deletions
|
@ -254,7 +254,7 @@ Hash hashFile(HashType ht, const Path & path)
|
|||
Hash hash(ht);
|
||||
start(ht, ctx);
|
||||
|
||||
AutoCloseFD fd = open(path.c_str(), O_RDONLY);
|
||||
AutoCloseFD fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
|
||||
if (fd == -1) throw SysError(format("opening file ‘%1%’") % path);
|
||||
|
||||
unsigned char buf[8192];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue