mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
openLockFile: Return an AutoCloseFD
This commit is contained in:
parent
c0f2f4eeef
commit
a55f589720
3 changed files with 7 additions and 7 deletions
|
@ -13,7 +13,7 @@
|
|||
namespace nix {
|
||||
|
||||
|
||||
int openLockFile(const Path & path, bool create)
|
||||
AutoCloseFD openLockFile(const Path & path, bool create)
|
||||
{
|
||||
AutoCloseFD fd;
|
||||
|
||||
|
@ -21,7 +21,7 @@ int openLockFile(const Path & path, bool create)
|
|||
if (!fd && (create || errno != ENOENT))
|
||||
throw SysError(format("opening lock file ‘%1%’") % path);
|
||||
|
||||
return fd.release();
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue