diff options
-rw-r--r-- | util-linux/fdflush.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index 7f5b6c9be..a4245c7e3 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c | |||
@@ -2,7 +2,8 @@ | |||
2 | /* | 2 | /* |
3 | * Mini fdflush implementation for busybox | 3 | * Mini fdflush implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. | 5 | * Copyright (C) 1995, 1996 by Bruce Perens <bruce@perens.com>. |
6 | * Copyright (C) 2003 by Erik Andersen <andersen@codeoet.org> | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * 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) | |||
33 | { | 34 | { |
34 | int fd; | 35 | int fd; |
35 | 36 | ||
36 | if (argc <= 1 || **(++argv) == '-') | 37 | if (argc <= 1) |
37 | show_usage(); | 38 | show_usage(); |
38 | 39 | if ((fd = open(*(++argv), 0)) < 0) | |
39 | if ((fd = open(*argv, 0)) < 0) | 40 | goto die_the_death; |
40 | perror_msg_and_die("%s", *argv); | ||
41 | 41 | ||
42 | if (ioctl(fd, FDFLUSH, 0)) | 42 | if (ioctl(fd, FDFLUSH, 0)) |
43 | perror_msg_and_die("%s", *argv); | 43 | goto die_the_death; |
44 | 44 | ||
45 | return EXIT_SUCCESS; | 45 | return EXIT_SUCCESS; |
46 | |||
47 | die_the_death: | ||
48 | perror_msg_and_die(NULL); | ||
46 | } | 49 | } |