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.
This commit is contained in:
parent
a3d7f575c0
commit
cc2a9f52a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151158
@ -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;
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user