aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-04-03 12:36:03 +0000
committerEric Andersen <andersen@codepoet.org>2004-04-03 12:36:03 +0000
commit522a2f3b395eec6576c24dbc0b4aa53aacff82f6 (patch)
tree74f4963dc2efac55cb50f182953ca62689be7e20
parent25d82397f764f8e72a59ec37f5296f84c0f8916e (diff)
downloadbusybox-522a2f3b395eec6576c24dbc0b4aa53aacff82f6.tar.gz
Everything should be made as simple as possible. But no simpler.
-rw-r--r--util-linux/fdformat.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c
index 930525848..bd4527581 100644
--- a/util-linux/fdformat.c
+++ b/util-linux/fdformat.c
@@ -107,12 +107,18 @@ int fdformat_main(int argc,char **argv)
bb_xioctl(fd, FDFMTBEG,NULL,"FDFMTBEG");
/* n == track */
- for (n = 0; n < param.track; n++) {
- descr.track = n;
- for(descr.head=0, print_and_flush("%3d\b\b\b", n) ; descr.head < param.head; descr.head++){
- bb_xioctl(fd,FDFMTTRK, &descr,"FDFMTTRK");
- }
+ for (n = 0; n < param.track; n++)
+ {
+ descr.head = 0;
+ descr.track = n;
+ bb_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");
+ }
}
+
bb_xioctl(fd,FDFMTEND,NULL,"FDFMTEND");
print_and_flush("done\n", NULL);