diff options
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r-- | src/libstore/pathlocks.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index 955ae3a34..3e654c1c9 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -17,9 +17,7 @@ namespace nix { AutoCloseFD openLockFile(const Path & path, bool create) { - AutoCloseFD fd; - - fd = open(path.c_str(), O_CLOEXEC | O_RDWR | (create ? O_CREAT : 0), 0600); + AutoCloseFD fd{open(path.c_str(), O_CLOEXEC | O_RDWR | (create ? O_CREAT : 0), 0600)}; if (!fd && (create || errno != ENOENT)) throw SysError("opening lock file '%1%'", path); |