summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2003-03-07 18:03:02 +0000
committerEric Andersen2003-03-07 18:03:02 +0000
commit3719e9e7908ae002ef579b2ce39273f9d7130d40 (patch)
tree5b0f6b902d9221efb6764a9f784b5819f57989a2
parent1bc5fa8c0cade0a70c106b2770e9042239fd618f (diff)
downloadbusybox-3719e9e7908ae002ef579b2ce39273f9d7130d40.zip
busybox-3719e9e7908ae002ef579b2ce39273f9d7130d40.tar.gz
Scrub things a bit, shave off a few bytes.
-Erik
-rw-r--r--util-linux/fdflush.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index 7f5b6c9..a4245c7 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -2,7 +2,8 @@
/*
* Mini fdflush implementation for busybox
*
- * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
+ * Copyright (C) 1995, 1996 by Bruce Perens <bruce@perens.com>.
+ * Copyright (C) 2003 by Erik Andersen <andersen@codeoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,14 +34,16 @@ extern int fdflush_main(int argc, char **argv)
{
int fd;
- if (argc <= 1 || **(++argv) == '-')
+ if (argc <= 1)
show_usage();
-
- if ((fd = open(*argv, 0)) < 0)
- perror_msg_and_die("%s", *argv);
+ if ((fd = open(*(++argv), 0)) < 0)
+ goto die_the_death;
if (ioctl(fd, FDFLUSH, 0))
- perror_msg_and_die("%s", *argv);
+ goto die_the_death;
return EXIT_SUCCESS;
+
+die_the_death:
+ perror_msg_and_die(NULL);
}