From cc2a9f52a7207fc2164f94b73ce784d7834f15b7 Mon Sep 17 00:00:00 2001 From: "Christian S.J. Peron" Date: Sun, 9 Oct 2005 04:45:41 +0000 Subject: [PATCH] Finish off style(9) fixes which I started two revisions ago. This basically changes the indentation style from 4 spaces to 8 spaces which we expect to see in other FreeBSD source files. --- usr.bin/lockf/lockf.c | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 7fb87916014..58a08a30a4b 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -131,10 +131,11 @@ main(int argc, char **argv) static void cleanup(void) { - if (keep) - flock(lockfd, LOCK_UN); - else - unlink(lockname); + + if (keep) + flock(lockfd, LOCK_UN); + else + unlink(lockname); } /* @@ -144,10 +145,11 @@ cleanup(void) static void killed(int sig) { - cleanup(); - signal(sig, SIG_DFL); - if (kill(getpid(), sig) == -1) - err(EX_OSERR, "kill failed"); + + cleanup(); + signal(sig, SIG_DFL); + if (kill(getpid(), sig) == -1) + err(EX_OSERR, "kill failed"); } /* @@ -156,15 +158,17 @@ killed(int sig) static void timeout(int sig __unused) { - timed_out = 1; + + timed_out = 1; } static void usage(void) { - fprintf(stderr, - "usage: lockf [-ks] [-t seconds] file command [arguments]\n"); - exit(EX_USAGE); + + fprintf(stderr, + "usage: lockf [-ks] [-t seconds] file command [arguments]\n"); + exit(EX_USAGE); } /* @@ -173,12 +177,12 @@ usage(void) static int wait_for_lock(const char *name, int flags) { - int fd; - - if ((fd = open(name, O_CREAT|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { - if (errno == EINTR || errno == EAGAIN) - return (-1); - err(EX_CANTCREAT, "cannot open %s", name); - } - return (fd); + int fd; + + if ((fd = open(name, O_CREAT|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { + if (errno == EINTR || errno == EAGAIN) + return (-1); + err(EX_CANTCREAT, "cannot open %s", name); + } + return (fd); } -- 2.45.2