diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2012-03-05T19·29+0100 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2012-03-05T19·29+0100 |
commit | 35355fc1fcffbe859395e360c0a6a1463f137d63 (patch) | |
tree | 0d5ed221e64ca64303c2f88dcf68cc054ba5e8e6 /src/libstore/gc.cc | |
parent | 7b22bec252a155514d811a8e2acc21562ac02bd4 (diff) |
Set the close-on-exec flag on file descriptors
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r-- | src/libstore/gc.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index e1e7b4c1c54f..e27c63de26ae 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -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...")); |