1
0
Fork 0
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:
Eelco Dolstra 2012-03-05 20:29:00 +01:00
parent 7b22bec252
commit 35355fc1fc
5 changed files with 20 additions and 3 deletions

View file

@ -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..."));