[BusyBox-cvs] busybox/util-linux freeramdisk.c,1.21,1.22
Glenn McGrath
bug1 at busybox.net
Thu May 8 13:09:31 UTC 2003
Update of /var/cvs/busybox/util-linux
In directory winder:/tmp/cvs-serv6280/util-linux
Modified Files:
freeramdisk.c
Log Message:
Use xopen instead of xfopen
Index: freeramdisk.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/freeramdisk.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- freeramdisk.c 19 Mar 2003 09:13:00 -0000 1.21
+++ freeramdisk.c 8 May 2003 13:09:28 -0000 1.22
@@ -26,7 +26,6 @@
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <errno.h>
#include <stdlib.h>
#include "busybox.h"
@@ -38,17 +37,17 @@
freeramdisk_main(int argc, char **argv)
{
int result;
- FILE *f;
+ int fd;
if (argc != 2) {
bb_show_usage();
}
- f = bb_xfopen(argv[1], "r+");
+ fd = bb_xopen(argv[1], O_RDWR);
- result = ioctl(fileno(f), BLKFLSBUF);
+ result = ioctl(fd, BLKFLSBUF);
#ifdef CONFIG_FEATURE_CLEAN_UP
- fclose(f);
+ close(fd);
#endif
if (result < 0) {
bb_perror_msg_and_die("failed ioctl on %s", argv[1]);
More information about the busybox-cvs
mailing list