aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-09 16:15:58 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-09 16:37:08 +0200
commit202683a4fc148dc228de226e9980a3f27754b854 (patch)
treedd75cf8f873a913ac3baf222eb93981622407d5f /src/libstore/pathlocks.cc
parent9bdd949cfdc9e49f1e01460a2a73215cac3ec904 (diff)
Use O_CLOEXEC in most places
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index eddf5bcbd..d0a0f812e 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -16,12 +16,10 @@ int openLockFile(const Path & path, bool create)
{
AutoCloseFD fd;
- fd = open(path.c_str(), O_RDWR | (create ? O_CREAT : 0), 0600);
+ fd = open(path.c_str(), O_CLOEXEC | O_RDWR | (create ? O_CREAT : 0), 0600);
if (fd == -1 && (create || errno != ENOENT))
throw SysError(format("opening lock file ‘%1%’") % path);
- closeOnExec(fd);
-
return fd.borrow();
}