diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-05-08 13:09:28 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-05-08 13:09:28 +0000 |
commit | 8c6887c855460ee9e688e2a51e29f99faa2a2d8c (patch) | |
tree | 83af3734b04512a7ff5821530831b39210b73bea /util-linux/freeramdisk.c | |
parent | 7b3edeb14d46d25bc1bb8a732d951e6075e7e59c (diff) | |
download | busybox-w32-8c6887c855460ee9e688e2a51e29f99faa2a2d8c.tar.gz busybox-w32-8c6887c855460ee9e688e2a51e29f99faa2a2d8c.tar.bz2 busybox-w32-8c6887c855460ee9e688e2a51e29f99faa2a2d8c.zip |
Use xopen instead of xfopen
Diffstat (limited to 'util-linux/freeramdisk.c')
-rw-r--r-- | util-linux/freeramdisk.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index 9276a6c40..00dc00841 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <sys/ioctl.h> | 28 | #include <sys/ioctl.h> |
29 | #include <errno.h> | ||
30 | #include <stdlib.h> | 29 | #include <stdlib.h> |
31 | #include "busybox.h" | 30 | #include "busybox.h" |
32 | 31 | ||
@@ -38,17 +37,17 @@ extern int | |||
38 | freeramdisk_main(int argc, char **argv) | 37 | freeramdisk_main(int argc, char **argv) |
39 | { | 38 | { |
40 | int result; | 39 | int result; |
41 | FILE *f; | 40 | int fd; |
42 | 41 | ||
43 | if (argc != 2) { | 42 | if (argc != 2) { |
44 | bb_show_usage(); | 43 | bb_show_usage(); |
45 | } | 44 | } |
46 | 45 | ||
47 | f = bb_xfopen(argv[1], "r+"); | 46 | fd = bb_xopen(argv[1], O_RDWR); |
48 | 47 | ||
49 | result = ioctl(fileno(f), BLKFLSBUF); | 48 | result = ioctl(fd, BLKFLSBUF); |
50 | #ifdef CONFIG_FEATURE_CLEAN_UP | 49 | #ifdef CONFIG_FEATURE_CLEAN_UP |
51 | fclose(f); | 50 | close(fd); |
52 | #endif | 51 | #endif |
53 | if (result < 0) { | 52 | if (result < 0) { |
54 | bb_perror_msg_and_die("failed ioctl on %s", argv[1]); | 53 | bb_perror_msg_and_die("failed ioctl on %s", argv[1]); |