diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 15:50:21 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 15:50:21 +0200 |
commit | 795ffc5e62e8ba383575dbcd9943a580d4bd3358 (patch) | |
tree | c128889056202b255e2f22afeb7717894d350862 /src/lock.c | |
parent | 5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (diff) |
formatting changes
Manual format adjustments.
Comment adjustments.
Remove usage of the register keyword.
Diffstat (limited to 'src/lock.c')
-rw-r--r-- | src/lock.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -6,10 +6,10 @@ #include <unistd.h> /** - @file lock.c - @author djb - @source qmail - @brief locking of resources + @file lock.c + @author djb + @source qmail + @brief locking of resources */ #ifdef HASFLOCK @@ -17,10 +17,12 @@ int lock_ex(int fd) { return flock(fd, LOCK_EX); } + int lock_exnb(int fd) { return flock(fd, LOCK_EX | LOCK_NB); } + int lock_un(int fd) { return flock(fd, LOCK_UN); @@ -30,10 +32,12 @@ int lock_ex(int fd) { return lockf(fd, 1, 0); } + int lock_exnb(int fd) { return lockf(fd, 2, 0); } + int lock_un(int fd) { return lockf(fd, 0, 0); |