summaryrefslogtreecommitdiff
path: root/util-linux/fdformat.c
diff options
context:
space:
mode:
authorRob Landley2006-08-03 15:41:12 +0000
committerRob Landley2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /util-linux/fdformat.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'util-linux/fdformat.c')
-rw-r--r--util-linux/fdformat.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c
index f94d455..63ec220 100644
--- a/util-linux/fdformat.c
+++ b/util-linux/fdformat.c
@@ -9,14 +9,6 @@
* 5 July 2003 -- modified for Busybox by Erik Andersen
*/
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
#include "busybox.h"
@@ -60,10 +52,10 @@ static void print_and_flush(const char * __restrict format, ...)
va_start(arg, format);
bb_vfprintf(stdout, format, arg);
va_end(arg);
- bb_xfflush_stdout();
+ xfflush_stdout();
}
-static void bb_xioctl(int fd, int request, void *argp, const char *string)
+static void xioctl(int fd, int request, void *argp, const char *string)
{
if (ioctl (fd, request, argp) < 0) {
bb_perror_msg_and_die(string);
@@ -95,9 +87,9 @@ int fdformat_main(int argc,char **argv)
/* O_RDWR for formatting and verifying */
- fd = bb_xopen(*argv,O_RDWR );
+ fd = xopen(*argv,O_RDWR );
- bb_xioctl(fd, FDGETPRM, &param, "FDGETPRM");/*original message was: "Could not determine current format type" */
+ xioctl(fd, FDGETPRM, &param, "FDGETPRM");/*original message was: "Could not determine current format type" */
print_and_flush("%s-sided, %d tracks, %d sec/track. Total capacity %d kB.\n",
(param.head == 2) ? "Double" : "Single",
@@ -105,22 +97,22 @@ int fdformat_main(int argc,char **argv)
/* FORMAT */
print_and_flush("Formatting ... ", NULL);
- bb_xioctl(fd, FDFMTBEG,NULL,"FDFMTBEG");
+ xioctl(fd, FDFMTBEG,NULL,"FDFMTBEG");
/* n == track */
for (n = 0; n < param.track; n++)
{
descr.head = 0;
descr.track = n;
- bb_xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK");
+ xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK");
print_and_flush("%3d\b\b\b", n);
if (param.head == 2) {
descr.head = 1;
- bb_xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK");
+ xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK");
}
}
- bb_xioctl(fd,FDFMTEND,NULL,"FDFMTEND");
+ xioctl(fd,FDFMTEND,NULL,"FDFMTEND");
print_and_flush("done\n", NULL);
/* VERIFY */