projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch last_pach62 from vodz. This patch moves all the /proc parsing
[oweals/busybox.git]
/
util-linux
/
fdflush.c
diff --git
a/util-linux/fdflush.c
b/util-linux/fdflush.c
index 6633e12128a922b8d488b5c71c13371fc813226b..7f5b6c9be1c04778b4c1d3ffe63ae7b44d7118e1 100644
(file)
--- a/
util-linux/fdflush.c
+++ b/
util-linux/fdflush.c
@@
-2,7
+2,6
@@
/*
* Mini fdflush implementation for busybox
*
/*
* Mini fdflush implementation for busybox
*
- *
* Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
*
* This program is free software; you can redistribute it and/or modify
* Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
*
* This program is free software; you can redistribute it and/or modify
@@
-21,36
+20,27
@@
*
*/
*
*/
-#include "busybox.h"
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
+#include <stdlib.h>
+#include "busybox.h"
/* From <linux/fd.h> */
#define FDFLUSH _IO(2,0x4b)
extern int fdflush_main(int argc, char **argv)
{
/* From <linux/fd.h> */
#define FDFLUSH _IO(2,0x4b)
extern int fdflush_main(int argc, char **argv)
{
- int value;
int fd;
if (argc <= 1 || **(++argv) == '-')
int fd;
if (argc <= 1 || **(++argv) == '-')
-
usage(fdflush_usage
);
+
show_usage(
);
- fd = open(*argv, 0);
- if (fd < 0) {
- perror(*argv);
- exit(FALSE);
- }
+ 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);
- exit(FALSE);
- }
- return(TRUE);
+ return EXIT_SUCCESS;
}
}