From 5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 14:41:53 +0200 Subject: initial clang-format --- src/lock.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'src/lock.c') diff --git a/src/lock.c b/src/lock.c index 4ac6b40..cec290e 100644 --- a/src/lock.c +++ b/src/lock.c @@ -1,9 +1,10 @@ -#include -#include -#include -#include #include "lock.h" +#include +#include +#include +#include + /** @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 -- cgit v1.2.3