diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-27 10:20:47 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-27 10:20:47 +0000 |
commit | 4daad9004d8f07991516970a1cbd77756fae7041 (patch) | |
tree | f1a17e4b168ef8fdf8af92ac5ce8deba89d38db2 /util-linux | |
parent | 1acdc89e992eb3f0548ff48ba586b31c9a0ae232 (diff) | |
download | busybox-w32-4daad9004d8f07991516970a1cbd77756fae7041.tar.gz busybox-w32-4daad9004d8f07991516970a1cbd77756fae7041.tar.bz2 busybox-w32-4daad9004d8f07991516970a1cbd77756fae7041.zip |
introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/dmesg.c | 6 | ||||
-rw-r--r-- | util-linux/fdisk.c | 16 | ||||
-rw-r--r-- | util-linux/fdisk_osf.c | 6 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 4 | ||||
-rw-r--r-- | util-linux/getopt.c | 2 | ||||
-rw-r--r-- | util-linux/ipcs.c | 10 | ||||
-rw-r--r-- | util-linux/more.c | 2 |
7 files changed, 23 insertions, 23 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 909cbd24e..3aa99e58f 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c | |||
@@ -38,12 +38,12 @@ int dmesg_main(int argc, char **argv) | |||
38 | 38 | ||
39 | for (in = 0; in<len;) { | 39 | for (in = 0; in<len;) { |
40 | if (last == '\n' && buf[in] == '<') in += 3; | 40 | if (last == '\n' && buf[in] == '<') in += 3; |
41 | else putchar(last = buf[in++]); | 41 | else bb_putchar(last = buf[in++]); |
42 | } | 42 | } |
43 | if (last != '\n') putchar('\n'); | 43 | if (last != '\n') bb_putchar('\n'); |
44 | } else { | 44 | } else { |
45 | write(1,buf,len); | 45 | write(1,buf,len); |
46 | if (len && buf[len-1]!='\n') putchar('\n'); | 46 | if (len && buf[len-1]!='\n') bb_putchar('\n'); |
47 | } | 47 | } |
48 | 48 | ||
49 | if (ENABLE_FEATURE_CLEAN_UP) free(buf); | 49 | if (ENABLE_FEATURE_CLEAN_UP) free(buf); |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 7981abc9f..9f30571e9 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -892,7 +892,7 @@ list_types(const char *const *sys) | |||
892 | next = ++done; | 892 | next = ++done; |
893 | } | 893 | } |
894 | } while (done < last[0]); | 894 | } while (done < last[0]); |
895 | putchar('\n'); | 895 | bb_putchar('\n'); |
896 | } | 896 | } |
897 | #endif /* FEATURE_FDISK_WRITABLE */ | 897 | #endif /* FEATURE_FDISK_WRITABLE */ |
898 | 898 | ||
@@ -2473,13 +2473,13 @@ print_buffer(char *pbuffer) | |||
2473 | printf("0x%03X:", i); | 2473 | printf("0x%03X:", i); |
2474 | printf(" %02X", (unsigned char) pbuffer[i]); | 2474 | printf(" %02X", (unsigned char) pbuffer[i]); |
2475 | if (l == MAX_PER_LINE - 1) { | 2475 | if (l == MAX_PER_LINE - 1) { |
2476 | puts(""); | 2476 | bb_putchar('\n'); |
2477 | l = -1; | 2477 | l = -1; |
2478 | } | 2478 | } |
2479 | } | 2479 | } |
2480 | if (l > 0) | 2480 | if (l > 0) |
2481 | puts(""); | 2481 | bb_putchar('\n'); |
2482 | puts(""); | 2482 | bb_putchar('\n'); |
2483 | } | 2483 | } |
2484 | 2484 | ||
2485 | static void | 2485 | static void |
@@ -2527,7 +2527,7 @@ xselect(void) | |||
2527 | char c; | 2527 | char c; |
2528 | 2528 | ||
2529 | while (1) { | 2529 | while (1) { |
2530 | putchar('\n'); | 2530 | bb_putchar('\n'); |
2531 | c = tolower(read_nonempty("Expert command (m for help): ")); | 2531 | c = tolower(read_nonempty("Expert command (m for help): ")); |
2532 | switch (c) { | 2532 | switch (c) { |
2533 | case 'a': | 2533 | case 'a': |
@@ -2588,7 +2588,7 @@ xselect(void) | |||
2588 | break; | 2588 | break; |
2589 | case 'q': | 2589 | case 'q': |
2590 | close(fd); | 2590 | close(fd); |
2591 | puts(""); | 2591 | bb_putchar('\n'); |
2592 | exit(0); | 2592 | exit(0); |
2593 | case 'r': | 2593 | case 'r': |
2594 | return; | 2594 | return; |
@@ -2867,7 +2867,7 @@ int fdisk_main(int argc, char **argv) | |||
2867 | 2867 | ||
2868 | while (1) { | 2868 | while (1) { |
2869 | int c; | 2869 | int c; |
2870 | putchar('\n'); | 2870 | bb_putchar('\n'); |
2871 | c = tolower(read_nonempty("Command (m for help): ")); | 2871 | c = tolower(read_nonempty("Command (m for help): ")); |
2872 | switch (c) { | 2872 | switch (c) { |
2873 | case 'a': | 2873 | case 'a': |
@@ -2947,7 +2947,7 @@ int fdisk_main(int argc, char **argv) | |||
2947 | break; | 2947 | break; |
2948 | case 'q': | 2948 | case 'q': |
2949 | close(fd); | 2949 | close(fd); |
2950 | puts(""); | 2950 | bb_putchar('\n'); |
2951 | return 0; | 2951 | return 0; |
2952 | case 's': | 2952 | case 's': |
2953 | #if ENABLE_FEATURE_SUN_LABEL | 2953 | #if ENABLE_FEATURE_SUN_LABEL |
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index f6486d5f9..726138265 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c | |||
@@ -394,7 +394,7 @@ bsd_select(void) | |||
394 | #endif | 394 | #endif |
395 | 395 | ||
396 | while (1) { | 396 | while (1) { |
397 | putchar('\n'); | 397 | bb_putchar('\n'); |
398 | switch (tolower(read_nonempty("BSD disklabel command (m for help): "))) { | 398 | switch (tolower(read_nonempty("BSD disklabel command (m for help): "))) { |
399 | case 'd': | 399 | case 'd': |
400 | xbsd_delete_part(); | 400 | xbsd_delete_part(); |
@@ -521,7 +521,7 @@ xbsd_print_disklabel(int show_all) | |||
521 | printf(" ecc"); | 521 | printf(" ecc"); |
522 | if (lp->d_flags & BSD_D_BADSECT) | 522 | if (lp->d_flags & BSD_D_BADSECT) |
523 | printf(" badsect"); | 523 | printf(" badsect"); |
524 | puts(""); | 524 | bb_putchar('\n'); |
525 | /* On various machines the fields of *lp are short/int/long */ | 525 | /* On various machines the fields of *lp are short/int/long */ |
526 | /* In order to avoid problems, we cast them all to long. */ | 526 | /* In order to avoid problems, we cast them all to long. */ |
527 | printf("bytes/sector: %ld\n", (long) lp->d_secsize); | 527 | printf("bytes/sector: %ld\n", (long) lp->d_secsize); |
@@ -588,7 +588,7 @@ xbsd_print_disklabel(int show_all) | |||
588 | printf("%22.22s", ""); | 588 | printf("%22.22s", ""); |
589 | break; | 589 | break; |
590 | } | 590 | } |
591 | puts(""); | 591 | bb_putchar('\n'); |
592 | } | 592 | } |
593 | } | 593 | } |
594 | } | 594 | } |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 531c1ea0b..5f92f3511 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -307,12 +307,12 @@ static int ask(const char *string, int def) | |||
307 | int c; | 307 | int c; |
308 | 308 | ||
309 | if (!repair) { | 309 | if (!repair) { |
310 | puts(""); | 310 | bb_putchar('\n'); |
311 | errors_uncorrected = 1; | 311 | errors_uncorrected = 1; |
312 | return 0; | 312 | return 0; |
313 | } | 313 | } |
314 | if (automatic) { | 314 | if (automatic) { |
315 | puts(""); | 315 | bb_putchar('\n'); |
316 | if (!def) | 316 | if (!def) |
317 | errors_uncorrected = 1; | 317 | errors_uncorrected = 1; |
318 | return def; | 318 | return def; |
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 94fb45761..4767d586c 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -195,7 +195,7 @@ static int generate_output(char **argv, int argc, const char *optstr, const stru | |||
195 | printf(" --"); | 195 | printf(" --"); |
196 | while (optind < argc) | 196 | while (optind < argc) |
197 | printf(" %s", normalize(argv[optind++])); | 197 | printf(" %s", normalize(argv[optind++])); |
198 | puts(""); | 198 | bb_putchar('\n'); |
199 | } | 199 | } |
200 | return exit_code; | 200 | return exit_code; |
201 | } | 201 | } |
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index 0b4dbf643..d5325902b 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c | |||
@@ -555,7 +555,7 @@ static void print_sem(int semid) | |||
555 | } | 555 | } |
556 | printf("%-10d %-10d %-10d %-10d %-10d\n", i, val, ncnt, zcnt, pid); | 556 | printf("%-10d %-10d %-10d %-10d %-10d\n", i, val, ncnt, zcnt, pid); |
557 | } | 557 | } |
558 | puts(""); | 558 | bb_putchar('\n'); |
559 | } | 559 | } |
560 | 560 | ||
561 | int ipcs_main(int argc, char **argv); | 561 | int ipcs_main(int argc, char **argv); |
@@ -603,19 +603,19 @@ int ipcs_main(int argc, char **argv) | |||
603 | 603 | ||
604 | if (!(flags & (flag_shm | flag_msg | flag_sem))) | 604 | if (!(flags & (flag_shm | flag_msg | flag_sem))) |
605 | flags |= flag_msg | flag_shm | flag_sem; | 605 | flags |= flag_msg | flag_shm | flag_sem; |
606 | puts(""); | 606 | bb_putchar('\n'); |
607 | 607 | ||
608 | if (flags & flag_shm) { | 608 | if (flags & flag_shm) { |
609 | do_shm(); | 609 | do_shm(); |
610 | puts(""); | 610 | bb_putchar('\n'); |
611 | } | 611 | } |
612 | if (flags & flag_sem) { | 612 | if (flags & flag_sem) { |
613 | do_sem(); | 613 | do_sem(); |
614 | puts(""); | 614 | bb_putchar('\n'); |
615 | } | 615 | } |
616 | if (flags & flag_msg) { | 616 | if (flags & flag_msg) { |
617 | do_msg(); | 617 | do_msg(); |
618 | puts(""); | 618 | bb_putchar('\n'); |
619 | } | 619 | } |
620 | fflush_stdout_and_exit(0); | 620 | fflush_stdout_and_exit(0); |
621 | } | 621 | } |
diff --git a/util-linux/more.c b/util-linux/more.c index dc5b4c99e..0a21a9afa 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -40,7 +40,7 @@ struct globals { | |||
40 | 40 | ||
41 | static void gotsig(int sig) | 41 | static void gotsig(int sig) |
42 | { | 42 | { |
43 | putchar('\n'); | 43 | bb_putchar('\n'); |
44 | setTermSettings(cin_fileno, &initial_settings); | 44 | setTermSettings(cin_fileno, &initial_settings); |
45 | exit(EXIT_FAILURE); | 45 | exit(EXIT_FAILURE); |
46 | } | 46 | } |