aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-11-03 05:17:14 -0600
committerRob Landley <rob@landley.net>2015-11-03 05:17:14 -0600
commit31cb5fc41086f5b2903f473f85e6305bf47cfa2c (patch)
treec6a2c26bddd92275d912444e518b5ac5b47de31e /toys
parent729401d267d6ce53443505210dd3dd9471056155 (diff)
downloadtoybox-31cb5fc41086f5b2903f473f85e6305bf47cfa2c.tar.gz
Whitespace and parentheses.
Diffstat (limited to 'toys')
-rw-r--r--toys/other/flock.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/toys/other/flock.c b/toys/other/flock.c
index 1d56a568..5f0190a9 100644
--- a/toys/other/flock.c
+++ b/toys/other/flock.c
@@ -25,13 +25,12 @@ config FLOCK
void flock_main(void)
{
- int fd = xstrtol(*toys.optargs, NULL, 10);
- int op;
+ int fd = xstrtol(*toys.optargs, NULL, 10), op;
- if ((toys.optflags & FLAG_u)) op = LOCK_UN;
+ if (toys.optflags & FLAG_u) op = LOCK_UN;
else op = (toys.optflags & FLAG_s) ? LOCK_SH : LOCK_EX;
- if ((toys.optflags & FLAG_n)) op |= LOCK_NB;
+ if (toys.optflags & FLAG_n) op |= LOCK_NB;
if (flock(fd, op)) {
if ((op & LOCK_NB) && errno == EAGAIN) toys.exitval = 1;