1
0
Fork 0
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:
Eelco Dolstra 2016-06-09 16:15:58 +02:00
parent 9bdd949cfd
commit 202683a4fc
9 changed files with 23 additions and 19 deletions

View file

@ -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];