diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 14:41:53 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 14:41:53 +0200 |
commit | 5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (patch) | |
tree | 684758441f5b431d0008253243034b6a4a29417c /src/lock.c | |
parent | 249866e3d1e11dc72eaa1305f4bb479ded92ef38 (diff) |
initial clang-format
Diffstat (limited to 'src/lock.c')
-rw-r--r-- | src/lock.c | 39 |
1 files changed, 29 insertions, 10 deletions
@@ -1,9 +1,10 @@ -#include <unistd.h> -#include <sys/types.h> -#include <sys/file.h> -#include <fcntl.h> #include "lock.h" +#include <fcntl.h> +#include <sys/file.h> +#include <sys/types.h> +#include <unistd.h> + /** @file lock.c @author djb @@ -12,11 +13,29 @@ */ #ifdef HASFLOCK -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); } +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); +} #else -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); } +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); +} #endif |