summaryrefslogtreecommitdiff
path: root/src/lock.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 15:50:21 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 15:50:21 +0200
commit795ffc5e62e8ba383575dbcd9943a580d4bd3358 (patch)
treec128889056202b255e2f22afeb7717894d350862 /src/lock.c
parent5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (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.c12
1 files changed, 8 insertions, 4 deletions
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 <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);