diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-03 19:56:34 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-03 19:56:34 +0000 |
commit | 9275814a9e6a3af390c932238c0b1130de8d0edd (patch) | |
tree | beabb5991332e0e2af56b4cb885a8fd6fc7daae2 /util-linux | |
parent | cf94446af7a75385955e0c4de2d5898b219f5719 (diff) | |
download | busybox-w32-9275814a9e6a3af390c932238c0b1130de8d0edd.tar.gz busybox-w32-9275814a9e6a3af390c932238c0b1130de8d0edd.tar.bz2 busybox-w32-9275814a9e6a3af390c932238c0b1130de8d0edd.zip |
lots of silly indent fixes
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fdformat.c | 54 | ||||
-rw-r--r-- | util-linux/fdisk.c | 4 | ||||
-rw-r--r-- | util-linux/mdev.c | 2 |
3 files changed, 29 insertions, 31 deletions
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c index efbdcc8fe..1441b9228 100644 --- a/util-linux/fdformat.c +++ b/util-linux/fdformat.c | |||
@@ -47,7 +47,7 @@ struct format_descr { | |||
47 | 47 | ||
48 | static void xioctl(int fd, int request, void *argp, const char *string) | 48 | static void xioctl(int fd, int request, void *argp, const char *string) |
49 | { | 49 | { |
50 | if (ioctl (fd, request, argp) < 0) { | 50 | if (ioctl(fd, request, argp) < 0) { |
51 | bb_perror_msg_and_die(string); | 51 | bb_perror_msg_and_die(string); |
52 | } | 52 | } |
53 | } | 53 | } |
@@ -67,17 +67,16 @@ int fdformat_main(int argc,char **argv) | |||
67 | argv += optind; | 67 | argv += optind; |
68 | 68 | ||
69 | /* R_OK is needed for verifying */ | 69 | /* R_OK is needed for verifying */ |
70 | if (stat(*argv,&st) < 0 || access(*argv,W_OK | R_OK ) < 0) { | 70 | if (stat(*argv, &st) < 0 || access(*argv, W_OK | R_OK ) < 0) { |
71 | bb_perror_msg_and_die("%s",*argv); | 71 | bb_perror_msg_and_die("%s", *argv); |
72 | } | 72 | } |
73 | if (!S_ISBLK(st.st_mode)) { | 73 | if (!S_ISBLK(st.st_mode)) { |
74 | bb_error_msg_and_die("%s: not a block device",*argv); | 74 | bb_error_msg_and_die("%s: not a block device", *argv); |
75 | /* do not test major - perhaps this was an USB floppy */ | 75 | /* do not test major - perhaps this was an USB floppy */ |
76 | } | 76 | } |
77 | 77 | ||
78 | |||
79 | /* O_RDWR for formatting and verifying */ | 78 | /* O_RDWR for formatting and verifying */ |
80 | fd = xopen(*argv,O_RDWR ); | 79 | fd = xopen(*argv, O_RDWR); |
81 | 80 | ||
82 | xioctl(fd, FDGETPRM, ¶m, "FDGETPRM");/*original message was: "Could not determine current format type" */ | 81 | xioctl(fd, FDGETPRM, ¶m, "FDGETPRM");/*original message was: "Could not determine current format type" */ |
83 | 82 | ||
@@ -86,44 +85,45 @@ int fdformat_main(int argc,char **argv) | |||
86 | param.track, param.sect, param.size >> 1); | 85 | param.track, param.sect, param.size >> 1); |
87 | 86 | ||
88 | /* FORMAT */ | 87 | /* FORMAT */ |
89 | printf("Formatting ... "); | 88 | printf("Formatting... "); |
90 | xioctl(fd, FDFMTBEG,NULL,"FDFMTBEG"); | 89 | xioctl(fd, FDFMTBEG, NULL, "FDFMTBEG"); |
91 | 90 | ||
92 | /* n == track */ | 91 | /* n == track */ |
93 | for (n = 0; n < param.track; n++) | 92 | for (n = 0; n < param.track; n++) { |
94 | { | 93 | descr.head = 0; |
95 | descr.head = 0; | 94 | descr.track = n; |
96 | descr.track = n; | 95 | xioctl(fd, FDFMTTRK, &descr, "FDFMTTRK"); |
97 | xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK"); | 96 | printf("%3d\b\b\b", n); |
98 | printf("%3d\b\b\b", n); | 97 | if (param.head == 2) { |
99 | if (param.head == 2) { | 98 | descr.head = 1; |
100 | descr.head = 1; | 99 | xioctl(fd, FDFMTTRK, &descr, "FDFMTTRK"); |
101 | xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK"); | 100 | } |
102 | } | ||
103 | } | 101 | } |
104 | 102 | ||
105 | xioctl(fd,FDFMTEND,NULL,"FDFMTEND"); | 103 | xioctl(fd, FDFMTEND, NULL, "FDFMTEND"); |
106 | printf("done\n"); | 104 | printf("done\n"); |
107 | 105 | ||
108 | /* VERIFY */ | 106 | /* VERIFY */ |
109 | if(verify) { | 107 | if (verify) { |
110 | /* n == cyl_size */ | 108 | /* n == cyl_size */ |
111 | n = param.sect*param.head*512; | 109 | n = param.sect*param.head*512; |
112 | 110 | ||
113 | data = xmalloc(n); | 111 | data = xmalloc(n); |
114 | printf("Verifying ... "); | 112 | printf("Verifying... "); |
115 | for (cyl = 0; cyl < param.track; cyl++) { | 113 | for (cyl = 0; cyl < param.track; cyl++) { |
116 | printf("%3d\b\b\b", cyl); | 114 | printf("%3d\b\b\b", cyl); |
117 | if((read_bytes = safe_read(fd,data,n))!= n ) { | 115 | read_bytes = safe_read(fd, data, n); |
118 | if(read_bytes < 0) { | 116 | if (read_bytes != n) { |
117 | if (read_bytes < 0) { | ||
119 | bb_perror_msg(bb_msg_read_error); | 118 | bb_perror_msg(bb_msg_read_error); |
120 | } | 119 | } |
121 | bb_error_msg_and_die("Problem reading cylinder %d, expected %d, read %d", cyl, n, read_bytes); | 120 | bb_error_msg_and_die("problem reading cylinder %d, expected %d, read %d", cyl, n, read_bytes); |
121 | // FIXME: maybe better seek & continue?? | ||
122 | } | 122 | } |
123 | /* Check backwards so we don't need a counter */ | 123 | /* Check backwards so we don't need a counter */ |
124 | while(--read_bytes>=0) { | 124 | while (--read_bytes >= 0) { |
125 | if( data[read_bytes] != FD_FILL_BYTE) { | 125 | if (data[read_bytes] != FD_FILL_BYTE) { |
126 | printf("bad data in cyl %d\nContinuing ... ",cyl); | 126 | printf("bad data in cyl %d\nContinuing... ",cyl); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | } | 129 | } |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 55f716657..85acaa4aa 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -4506,8 +4506,7 @@ change_sysid(void) | |||
4506 | label_sun != current_label_type && !get_nr_sects(p)) | 4506 | label_sun != current_label_type && !get_nr_sects(p)) |
4507 | { | 4507 | { |
4508 | printf(_("Partition %d does not exist yet!\n"), i + 1); | 4508 | printf(_("Partition %d does not exist yet!\n"), i + 1); |
4509 | }else{ | 4509 | } else while (1) { |
4510 | while (1) { | ||
4511 | sys = read_hex (get_sys_types()); | 4510 | sys = read_hex (get_sys_types()); |
4512 | 4511 | ||
4513 | if (!sys && label_sgi != current_label_type && | 4512 | if (!sys && label_sgi != current_label_type && |
@@ -4573,7 +4572,6 @@ change_sysid(void) | |||
4573 | dos_changed = 1; | 4572 | dos_changed = 1; |
4574 | break; | 4573 | break; |
4575 | } | 4574 | } |
4576 | } | ||
4577 | } | 4575 | } |
4578 | } | 4576 | } |
4579 | #endif /* CONFIG_FEATURE_FDISK_WRITABLE */ | 4577 | #endif /* CONFIG_FEATURE_FDISK_WRITABLE */ |
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index b292e14b7..f43393692 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
@@ -250,7 +250,7 @@ int mdev_main(int argc, char *argv[]) | |||
250 | } else { | 250 | } else { |
251 | action = getenv("ACTION"); | 251 | action = getenv("ACTION"); |
252 | env_path = getenv("DEVPATH"); | 252 | env_path = getenv("DEVPATH"); |
253 | if (!action || !env_path) | 253 | if (!action || !env_path) |
254 | bb_show_usage(); | 254 | bb_show_usage(); |
255 | 255 | ||
256 | sprintf(temp, "/sys%s", env_path); | 256 | sprintf(temp, "/sys%s", env_path); |