aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-09-17 16:28:10 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-09-17 16:28:10 +0000
commit9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e (patch)
tree94c3c0678d1349497abe2db6004e9331e50f6d37 /miscutils
parenta6127aacef047ed7661722705b052811fbe7f467 (diff)
downloadbusybox-w32-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.tar.gz
busybox-w32-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.tar.bz2
busybox-w32-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.zip
whitespace cleanup
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/Config.in2
-rw-r--r--miscutils/hdparm.c44
-rw-r--r--miscutils/less.c22
-rw-r--r--miscutils/readahead.c2
-rw-r--r--miscutils/strings.c2
5 files changed, 36 insertions, 36 deletions
diff --git a/miscutils/Config.in b/miscutils/Config.in
index dc3da6f9a..50ed4df99 100644
--- a/miscutils/Config.in
+++ b/miscutils/Config.in
@@ -292,7 +292,7 @@ config CONFIG_READAHEAD
292 significantly speed up system startup. 292 significantly speed up system startup.
293 293
294 As readahead(2) blocks until each file has been read, it is best to 294 As readahead(2) blocks until each file has been read, it is best to
295 run this applet as a background job. 295 run this applet as a background job.
296 296
297config CONFIG_RUNLEVEL 297config CONFIG_RUNLEVEL
298 bool "runlevel" 298 bool "runlevel"
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 1febcef2c..97f1b5752 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -755,7 +755,7 @@ static void identify(uint16_t *id_supplied)
755 strng = "<=10ms with INTRQ"; 755 strng = "<=10ms with INTRQ";
756 else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_50US_VAL) 756 else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_50US_VAL)
757 strng ="50us"; 757 strng ="50us";
758 else 758 else
759 strng = "Unknown"; 759 strng = "Unknown";
760 printf("\tDRQ response: %s\n\tPacket size: ", strng); /* Data Request (DRQ) */ 760 printf("\tDRQ response: %s\n\tPacket size: ", strng); /* Data Request (DRQ) */
761 761
@@ -817,7 +817,7 @@ static void identify(uint16_t *id_supplied)
817 817
818 if (bbbig > 1000) 818 if (bbbig > 1000)
819 printf("(%"PRIu64" GB)\n", bbbig/1000); 819 printf("(%"PRIu64" GB)\n", bbbig/1000);
820 else 820 else
821 printf("\n"); 821 printf("\n");
822 } 822 }
823 823
@@ -833,8 +833,8 @@ static void identify(uint16_t *id_supplied)
833 833
834 if (like_std != 1) 834 if (like_std != 1)
835 { 835 {
836 printf("IORDY%s(can%s be disabled)\n", 836 printf("IORDY%s(can%s be disabled)\n",
837 !(val[CAPAB_0] & IORDY_SUP) ? "(may be)" : "", 837 !(val[CAPAB_0] & IORDY_SUP) ? "(may be)" : "",
838 (val[CAPAB_0] & IORDY_OFF) ? "" :"not"); 838 (val[CAPAB_0] & IORDY_OFF) ? "" :"not");
839 } 839 }
840 else 840 else
@@ -843,7 +843,7 @@ static void identify(uint16_t *id_supplied)
843 if ((like_std == 1) && val[BUF_TYPE]) 843 if ((like_std == 1) && val[BUF_TYPE])
844 { 844 {
845 printf("\tBuffer type: %04x: %s%s\n", val[BUF_TYPE], 845 printf("\tBuffer type: %04x: %s%s\n", val[BUF_TYPE],
846 (val[BUF_TYPE] < 2) ? "single port, single-sector" : "dual port, multi-sector", 846 (val[BUF_TYPE] < 2) ? "single port, single-sector" : "dual port, multi-sector",
847 (val[BUF_TYPE] > 2) ? " with read caching ability" : ""); 847 (val[BUF_TYPE] > 2) ? " with read caching ability" : "");
848 } 848 }
849 849
@@ -1063,9 +1063,9 @@ static void identify(uint16_t *id_supplied)
1063 strng = " determined by the jumper"; 1063 strng = " determined by the jumper";
1064 else if ((jj & DEV_DET) == CSEL_VAL) 1064 else if ((jj & DEV_DET) == CSEL_VAL)
1065 strng = " determined by CSEL"; 1065 strng = " determined by CSEL";
1066 else 1066 else
1067 strng = ""; 1067 strng = "";
1068 printf("HW reset results:\n\tCBLID- %s Vih\n\tDevice num = %i%s\n", 1068 printf("HW reset results:\n\tCBLID- %s Vih\n\tDevice num = %i%s\n",
1069 (val[HWRST_RSLT] & CBLID) ? "above" : "below", !(oo), strng); 1069 (val[HWRST_RSLT] & CBLID) ? "above" : "below", !(oo), strng);
1070 } 1070 }
1071 1071
@@ -1200,8 +1200,8 @@ static void dump_identity(const struct hd_driveid *id)
1200 printf(" (maybe):"); 1200 printf(" (maybe):");
1201 1201
1202 printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads, 1202 printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads,
1203 id->cur_sectors, 1203 id->cur_sectors,
1204 (BB_BIG_ENDIAN) ? 1204 (BB_BIG_ENDIAN) ?
1205 (long unsigned int)(id->cur_capacity0 << 16) | id->cur_capacity1 : 1205 (long unsigned int)(id->cur_capacity0 << 16) | id->cur_capacity1 :
1206 (long unsigned int)(id->cur_capacity1 << 16) | id->cur_capacity0, 1206 (long unsigned int)(id->cur_capacity1 << 16) | id->cur_capacity0,
1207 ((id->capability&2) == 0) ? "no" : "yes"); 1207 ((id->capability&2) == 0) ? "no" : "yes");
@@ -1213,7 +1213,7 @@ static void dump_identity(const struct hd_driveid *id)
1213 1213
1214 if (((id->capability&8) || (id->field_valid&2)) && id->field_valid&2) 1214 if (((id->capability&8) || (id->field_valid&2)) && id->field_valid&2)
1215 printf(", tPIO={min:%u,w/IORDY:%u}", id->eide_pio, id->eide_pio_iordy); 1215 printf(", tPIO={min:%u,w/IORDY:%u}", id->eide_pio, id->eide_pio_iordy);
1216 1216
1217 if ((id->capability&1) && (id->field_valid&2)) 1217 if ((id->capability&1) && (id->field_valid&2))
1218 printf(", tDMA={min:%u,rec:%u}", id->eide_dma_min, id->eide_dma_time); 1218 printf(", tDMA={min:%u,rec:%u}", id->eide_dma_min, id->eide_dma_time);
1219 1219
@@ -1254,7 +1254,7 @@ static void dump_identity(const struct hd_driveid *id)
1254 } 1254 }
1255 } 1255 }
1256 if (((id->capability&8) || (id->field_valid&2)) && id->field_valid&4) 1256 if (((id->capability&8) || (id->field_valid&2)) && id->field_valid&4)
1257 { 1257 {
1258 printf("\n UDMA modes: "); 1258 printf("\n UDMA modes: ");
1259 if (id->dma_ultra & 0x100) printf("*"); 1259 if (id->dma_ultra & 0x100) printf("*");
1260 if (id->dma_ultra & 0x001) printf("udma0 "); 1260 if (id->dma_ultra & 0x001) printf("udma0 ");
@@ -1399,7 +1399,7 @@ static void do_time(int flag, int fd)
1399 if (read_big_block (fd, buf)) return; 1399 if (read_big_block (fd, buf)) return;
1400 printf(" Timing cached reads: "); 1400 printf(" Timing cached reads: ");
1401 fflush(stdout); 1401 fflush(stdout);
1402 1402
1403 /* Now do the timing */ 1403 /* Now do the timing */
1404 iterations = 0; 1404 iterations = 0;
1405 getitimer(ITIMER_REAL, &e1); 1405 getitimer(ITIMER_REAL, &e1);
@@ -1422,9 +1422,9 @@ static void do_time(int flag, int fd)
1422 elapsed2 = (e1.it_value.tv_sec - e2.it_value.tv_sec) 1422 elapsed2 = (e1.it_value.tv_sec - e2.it_value.tv_sec)
1423 + ((e1.it_value.tv_usec - e2.it_value.tv_usec) / 1000000.0); 1423 + ((e1.it_value.tv_usec - e2.it_value.tv_usec) / 1000000.0);
1424 } while (--iterations); 1424 } while (--iterations);
1425 1425
1426 elapsed -= elapsed2; 1426 elapsed -= elapsed2;
1427 print_timing(BUFCACHE_FACTOR * total_MB, elapsed); 1427 print_timing(BUFCACHE_FACTOR * total_MB, elapsed);
1428 flush_buffer_cache(fd); 1428 flush_buffer_cache(fd);
1429 sleep(1); 1429 sleep(1);
1430 } 1430 }
@@ -1447,7 +1447,7 @@ static void do_time(int flag, int fd)
1447 elapsed = (e1.it_value.tv_sec - e2.it_value.tv_sec) 1447 elapsed = (e1.it_value.tv_sec - e2.it_value.tv_sec)
1448 + ((e1.it_value.tv_usec - e2.it_value.tv_usec) / 1000000.0); 1448 + ((e1.it_value.tv_usec - e2.it_value.tv_usec) / 1000000.0);
1449 } while (elapsed < 3.0 && iterations < max_iterations); 1449 } while (elapsed < 3.0 && iterations < max_iterations);
1450 1450
1451 total_MB = iterations * TIMING_BUF_MB; 1451 total_MB = iterations * TIMING_BUF_MB;
1452 print_timing(total_MB, elapsed); 1452 print_timing(total_MB, elapsed);
1453 } 1453 }
@@ -2124,7 +2124,7 @@ int hdparm_main(int argc, char **argv)
2124 do_flush |= do_timings |= (c == 't'); 2124 do_flush |= do_timings |= (c == 't');
2125 do_flush |= do_ctimings |= (c == 'T'); 2125 do_flush |= do_ctimings |= (c == 'T');
2126#ifdef HDIO_DRIVE_CMD 2126#ifdef HDIO_DRIVE_CMD
2127 if (c == 'S') parse_opts(&get_standby, &set_standby, &standby_requested, 0, INT_MAX); 2127 if (c == 'S') parse_opts(&get_standby, &set_standby, &standby_requested, 0, INT_MAX);
2128 if (c == 'D') parse_opts(&get_defects, &set_defects, &defects, 0, INT_MAX); 2128 if (c == 'D') parse_opts(&get_defects, &set_defects, &defects, 0, INT_MAX);
2129 if (c == 'P') parse_opts(&get_prefetch, &set_prefetch, &prefetch, 0, INT_MAX); 2129 if (c == 'P') parse_opts(&get_prefetch, &set_prefetch, &prefetch, 0, INT_MAX);
2130 parse_xfermode((c == 'X'), &get_xfermode, &set_xfermode, &xfermode_requested); 2130 parse_xfermode((c == 'X'), &get_xfermode, &set_xfermode, &xfermode_requested);
@@ -2138,22 +2138,22 @@ int hdparm_main(int argc, char **argv)
2138 reread_partn |= (c == 'z'); 2138 reread_partn |= (c == 'z');
2139 get_seagate = set_seagate |= (c == 'Z'); 2139 get_seagate = set_seagate |= (c == 'Z');
2140#endif 2140#endif
2141 USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(if (c == 'U') parse_opts(NULL, &unregister_hwif, &hwif, 0, INT_MAX)); 2141 USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(if (c == 'U') parse_opts(NULL, &unregister_hwif, &hwif, 0, INT_MAX));
2142#ifdef HDIO_GET_QDMA 2142#ifdef HDIO_GET_QDMA
2143 if (c == 'Q') { 2143 if (c == 'Q') {
2144#ifdef HDIO_SET_QDMA 2144#ifdef HDIO_SET_QDMA
2145 parse_opts(&get_dma_q, &set_dma_q, &dma_q, 0, INT_MAX); 2145 parse_opts(&get_dma_q, &set_dma_q, &dma_q, 0, INT_MAX);
2146#else 2146#else
2147 parse_opts(&get_dma_q, NULL, NULL, 0, 0); 2147 parse_opts(&get_dma_q, NULL, NULL, 0, 0);
2148#endif 2148#endif
2149 } 2149 }
2150#endif 2150#endif
2151 USE_FEATURE_HDPARM_HDIO_DRIVE_RESET(perform_reset = (c == 'r')); 2151 USE_FEATURE_HDPARM_HDIO_DRIVE_RESET(perform_reset = (c == 'r'));
2152 USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'x') parse_opts(NULL, &perform_tristate, &tristate, 0, 1)); 2152 USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'x') parse_opts(NULL, &perform_tristate, &tristate, 0, 1));
2153 USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'b') parse_opts(&get_busstate, &set_busstate, &busstate, 0, 2)); 2153 USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'b') parse_opts(&get_busstate, &set_busstate, &busstate, 0, 2));
2154#if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF 2154#if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF
2155 if (c == 'R') { 2155 if (c == 'R') {
2156 parse_opts(NULL, &scan_hwif, &hwif_data, 0, INT_MAX); 2156 parse_opts(NULL, &scan_hwif, &hwif_data, 0, INT_MAX);
2157 hwif_ctrl = bb_xgetlarg((argv[optind]) ? argv[optind] : "", 10, 0, INT_MAX); 2157 hwif_ctrl = bb_xgetlarg((argv[optind]) ? argv[optind] : "", 10, 0, INT_MAX);
2158 hwif_irq = bb_xgetlarg((argv[optind+1]) ? argv[optind+1] : "", 10, 0, INT_MAX); 2158 hwif_irq = bb_xgetlarg((argv[optind+1]) ? argv[optind+1] : "", 10, 0, INT_MAX);
2159 /* Move past the 2 additional arguments */ 2159 /* Move past the 2 additional arguments */
diff --git a/miscutils/less.c b/miscutils/less.c
index c13d7b8a2..bde2a4527 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -610,26 +610,26 @@ static char *process_regex_on_line(char *line, regex_t *pattern, int action)
610 610
611 match_found = 0; 611 match_found = 0;
612 match_status = regexec(pattern, line2, 1, &match_structs, 0); 612 match_status = regexec(pattern, line2, 1, &match_structs, 0);
613 613
614 while (match_status == 0) { 614 while (match_status == 0) {
615 if (match_found == 0) 615 if (match_found == 0)
616 match_found = 1; 616 match_found = 1;
617 617
618 if (action) { 618 if (action) {
619 growline = xasprintf("%s%.*s%s%.*s%s", growline, match_structs.rm_so, line2, HIGHLIGHT, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so, NORMAL); 619 growline = xasprintf("%s%.*s%s%.*s%s", growline, match_structs.rm_so, line2, HIGHLIGHT, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so, NORMAL);
620 } 620 }
621 else { 621 else {
622 growline = xasprintf("%s%.*s%.*s", growline, match_structs.rm_so - 4, line2, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so); 622 growline = xasprintf("%s%.*s%.*s", growline, match_structs.rm_so - 4, line2, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so);
623 } 623 }
624 624
625 line2 += match_structs.rm_eo; 625 line2 += match_structs.rm_eo;
626 match_status = regexec(pattern, line2, 1, &match_structs, REG_NOTBOL); 626 match_status = regexec(pattern, line2, 1, &match_structs, REG_NOTBOL);
627 } 627 }
628 628
629 growline = xasprintf("%s%s", growline, line2); 629 growline = xasprintf("%s%s", growline, line2);
630 630
631 return (match_found ? growline : line); 631 return (match_found ? growline : line);
632 632
633 free(growline); 633 free(growline);
634 free(line2); 634 free(line2);
635} 635}
@@ -656,7 +656,7 @@ static void regex_process(void)
656 putchar((match_backwards) ? '?' : '/'); 656 putchar((match_backwards) ? '?' : '/');
657 uncomp_regex[0] = 0; 657 uncomp_regex[0] = 0;
658 fgets(uncomp_regex, sizeof(uncomp_regex), inp); 658 fgets(uncomp_regex, sizeof(uncomp_regex), inp);
659 659
660 if (strlen(uncomp_regex) == 1) { 660 if (strlen(uncomp_regex) == 1) {
661 if (num_matches) 661 if (num_matches)
662 goto_match(match_backwards ? match_pos - 1 : match_pos + 1); 662 goto_match(match_backwards ? match_pos - 1 : match_pos + 1);
@@ -665,7 +665,7 @@ static void regex_process(void)
665 return; 665 return;
666 } 666 }
667 uncomp_regex[strlen(uncomp_regex) - 1] = '\0'; 667 uncomp_regex[strlen(uncomp_regex) - 1] = '\0';
668 668
669 /* Compile the regex and check for errors */ 669 /* Compile the regex and check for errors */
670 xregcomp(&pattern, uncomp_regex, 0); 670 xregcomp(&pattern, uncomp_regex, 0);
671 671
@@ -677,7 +677,7 @@ static void regex_process(void)
677 } 677 }
678 } 678 }
679 old_pattern = pattern; 679 old_pattern = pattern;
680 680
681 /* Reset variables */ 681 /* Reset variables */
682 match_lines = xrealloc(match_lines, sizeof(int)); 682 match_lines = xrealloc(match_lines, sizeof(int));
683 match_lines[0] = -1; 683 match_lines[0] = -1;
@@ -694,7 +694,7 @@ static void regex_process(void)
694 j++; 694 j++;
695 } 695 }
696 } 696 }
697 697
698 num_matches = j; 698 num_matches = j;
699 if ((match_lines[0] != -1) && (num_flines > height - 2)) { 699 if ((match_lines[0] != -1) && (num_flines > height - 2)) {
700 if (match_backwards) { 700 if (match_backwards) {
diff --git a/miscutils/readahead.c b/miscutils/readahead.c
index 8221bb4be..49cd7fd09 100644
--- a/miscutils/readahead.c
+++ b/miscutils/readahead.c
@@ -22,7 +22,7 @@ int readahead_main(int argc, char **argv)
22 while (*++argv) { 22 while (*++argv) {
23 if ((f = bb_wfopen(*argv, "r")) != NULL) { 23 if ((f = bb_wfopen(*argv, "r")) != NULL) {
24 int r, fd=fileno(f); 24 int r, fd=fileno(f);
25 25
26 r = readahead(fd, 0, fdlength(fd)); 26 r = readahead(fd, 0, fdlength(fd));
27 fclose(f); 27 fclose(f);
28 if (r >= 0) continue; 28 if (r >= 0) continue;
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 9a76c8534..e9f335ebd 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -3,7 +3,7 @@
3 * strings implementation for busybox 3 * strings implementation for busybox
4 * 4 *
5 * Copyright Tito Ragusa <farmatito@tiscali.it> 5 * Copyright Tito Ragusa <farmatito@tiscali.it>
6 * 6 *
7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 */ 8 */
9 9