From 202683a4fc148dc228de226e9980a3f27754b854 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 Jun 2016 16:15:58 +0200 Subject: Use O_CLOEXEC in most places --- src/libstore/build.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libstore/build.cc') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index cbb4c4a75..15fff8a6b 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -509,10 +509,9 @@ void UserLock::acquire() /* We already have a lock on this one. */ continue; - AutoCloseFD fd = open(fnUserLock.c_str(), O_RDWR | O_CREAT, 0600); + AutoCloseFD fd = open(fnUserLock.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0600); if (fd == -1) throw SysError(format("opening user lock ‘%1%’") % fnUserLock); - closeOnExec(fd); if (lockFile(fd, ltWrite, false)) { fdUserLock = fd.borrow(); -- cgit v1.2.3