about summary refs log tree commit diff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2012-03-05T19·29+0100
committerEelco Dolstra <e.dolstra@tudelft.nl>2012-03-05T19·29+0100
commit35355fc1fcffbe859395e360c0a6a1463f137d63 (patch)
tree0d5ed221e64ca64303c2f88dcf68cc054ba5e8e6 /src/libstore/pathlocks.cc
parent7b22bec252a155514d811a8e2acc21562ac02bd4 (diff)
Set the close-on-exec flag on file descriptors
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index 645f4cd67e7e..b858ed238de0 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -20,6 +20,8 @@ int openLockFile(const Path & path, bool create)
     if (fd == -1 && (create || errno != ENOENT))
         throw SysError(format("opening lock file `%1%'") % path);
 
+    closeOnExec(fd);
+
     return fd.borrow();
 }