From 795ffc5e62e8ba383575dbcd9943a580d4bd3358 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 15:50:21 +0200 Subject: formatting changes Manual format adjustments. Comment adjustments. Remove usage of the register keyword. --- src/lock.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/lock.c') diff --git a/src/lock.c b/src/lock.c index cec290e..cadb07c 100644 --- a/src/lock.c +++ b/src/lock.c @@ -6,10 +6,10 @@ #include /** - @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); -- cgit v1.2.3