summaryrefslogtreecommitdiff
path: root/util-linux/fdflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/fdflush.c')
-rw-r--r--util-linux/fdflush.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index 380015d..5eb93dd 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -31,26 +31,16 @@
extern int fdflush_main(int argc, char **argv)
{
- int value;
int fd;
if (argc <= 1 || **(++argv) == '-')
usage(fdflush_usage);
- fd = open(*argv, 0);
- if (fd < 0) {
- perror(*argv);
- return EXIT_FAILURE;
- }
+ if ((fd = open(*argv, 0)) < 0)
+ perror_msg_and_die("%s", *argv);
- value = ioctl(fd, FDFLUSH, 0);
- /* Don't bother closing. Exit does
- * that, so we can save a few bytes */
- /* close(fd); */
+ if (ioctl(fd, FDFLUSH, 0))
+ perror_msg_and_die("%s", *argv);
- if (value) {
- perror(*argv);
- return EXIT_FAILURE;
- }
return EXIT_SUCCESS;
}