diff options
Diffstat (limited to 'src/libstore/lock.cc')
-rw-r--r-- | src/libstore/lock.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/lock.cc b/src/libstore/lock.cc index 165e4969f..80c75eaa5 100644 --- a/src/libstore/lock.cc +++ b/src/libstore/lock.cc @@ -76,7 +76,7 @@ struct SimpleUserLock : UserLock auto fnUserLock = fmt("%s/userpool/%s", settings.nixStateDir,pw->pw_uid); - AutoCloseFD fd = open(fnUserLock.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0600); + AutoCloseFD fd{open(fnUserLock.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0600)}; if (!fd) throw SysError("opening user lock '%s'", fnUserLock); @@ -148,7 +148,7 @@ struct AutoUserLock : UserLock auto fnUserLock = fmt("%s/userpool2/slot-%d", settings.nixStateDir, i); - AutoCloseFD fd = open(fnUserLock.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0600); + AutoCloseFD fd{open(fnUserLock.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0600)}; if (!fd) throw SysError("opening user lock '%s'", fnUserLock); |