X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=util-linux%2Ffdflush.c;h=f10cceae08054830b8659780ff2fab62b143cd66;hb=f1bbb22dca4d39aa227246f4c2ee90acd7e512a4;hp=56ea2244d7444189fb2b13c16325c608268a695e;hpb=9cf3bfa7c1bf3ad959c61711c9a5ac1969149300;p=oweals%2Fbusybox.git diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index 56ea2244d..f10cceae0 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c @@ -21,36 +21,27 @@ * */ -#include "internal.h" +#include "busybox.h" #include #include -#include #include +#include +/* From */ +#define FDFLUSH _IO(2,0x4b) extern int fdflush_main(int argc, char **argv) { - int value; int fd; - if (argc <= 1 || **(++argv) == '-') { - usage("fdflush device\n\nForce floppy disk drive to detect disk change\n"); - } + if (argc <= 1 || **(++argv) == '-') + 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); - } - exit(TRUE); + return EXIT_SUCCESS; }