diff options
| author | Martin Ridgers <[email protected]> | 2021-11-30 16:26:05 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-02 11:35:46 +0100 |
| commit | 7ffa95f4d8f4520636a75496e267fef417fc1fb0 (patch) | |
| tree | 5373d338850798fdda4903004b16a5b5d84fddbb /zenstore/basicfile.cpp | |
| parent | Remove a LockFile's lock on destruction (diff) | |
| download | zen-7ffa95f4d8f4520636a75496e267fef417fc1fb0.tar.xz zen-7ffa95f4d8f4520636a75496e267fef417fc1fb0.zip | |
Do not block when trying to lock a lock file (POSIX)
Diffstat (limited to 'zenstore/basicfile.cpp')
| -rw-r--r-- | zenstore/basicfile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp index 413c78674..3edfc15ee 100644 --- a/zenstore/basicfile.cpp +++ b/zenstore/basicfile.cpp @@ -376,7 +376,7 @@ LockFile::Create(std::filesystem::path FileName, CbObject Payload, std::error_co return; } - int LockRet = flock(Fd, LOCK_EX); + int LockRet = flock(Fd, LOCK_EX|LOCK_NB); if (LockRet < 0) { Ec = zen::MakeErrorCodeFromLastError(); |