mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Set the close-on-exec flag on file descriptors
This commit is contained in:
parent
7b22bec252
commit
35355fc1fc
5 changed files with 20 additions and 3 deletions
|
@ -40,6 +40,7 @@ int LocalStore::openGCLock(LockType lockType)
|
|||
AutoCloseFD fdGCLock = open(fnGCLock.c_str(), O_RDWR | O_CREAT, 0600);
|
||||
if (fdGCLock == -1)
|
||||
throw SysError(format("opening global GC lock `%1%'") % fnGCLock);
|
||||
closeOnExec(fdGCLock);
|
||||
|
||||
if (!lockFile(fdGCLock, lockType, false)) {
|
||||
printMsg(lvlError, format("waiting for the big garbage collector lock..."));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue