diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-02 14:19:51 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-02 14:19:51 +0100 |
commit | 8131eea3dce5fba0dfb78e6083d1730423fad20b (patch) | |
tree | c098d7ba6ef9f4745425a29a330480e6088d6d9a /networking | |
parent | 0d8ea64af618dc83c3291b3b598636ed3d0854e4 (diff) | |
download | busybox-w32-8131eea3dce5fba0dfb78e6083d1730423fad20b.tar.gz busybox-w32-8131eea3dce5fba0dfb78e6083d1730423fad20b.tar.bz2 busybox-w32-8131eea3dce5fba0dfb78e6083d1730423fad20b.zip |
*: introduce and use ffulsh_all()
function old new delta
buffer_fill_and_print 179 196 +17
fflush_all - 9 +9
spawn 87 92 +5
rtcwake_main 455 453 -2
...
alarm_intr 93 84 -9
readcmd 1072 1062 -10
bb_ask 345 333 -12
more_main 845 832 -13
flush_stdout_stderr 42 23 -19
xfflush_stdout 27 - -27
flush_stderr 30 - -30
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397) Total: -366 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/arping.c | 2 | ||||
-rw-r--r-- | networking/ftpd.c | 2 | ||||
-rw-r--r-- | networking/ifupdown.c | 4 | ||||
-rw-r--r-- | networking/libiproute/ipaddress.c | 4 | ||||
-rw-r--r-- | networking/libiproute/iprule.c | 2 | ||||
-rw-r--r-- | networking/nc_bloaty.c | 2 | ||||
-rw-r--r-- | networking/ping.c | 2 | ||||
-rw-r--r-- | networking/telnetd.c | 4 | ||||
-rw-r--r-- | networking/traceroute.c | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/networking/arping.c b/networking/arping.c index 71690cf30..e3418a945 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -237,7 +237,7 @@ static bool recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM) | |||
237 | } else { | 237 | } else { |
238 | printf(" UNSOLICITED?\n"); | 238 | printf(" UNSOLICITED?\n"); |
239 | } | 239 | } |
240 | fflush(stdout); | 240 | fflush_all(); |
241 | } | 241 | } |
242 | received++; | 242 | received++; |
243 | if (FROM->sll_pkttype != PACKET_HOST) | 243 | if (FROM->sll_pkttype != PACKET_HOST) |
diff --git a/networking/ftpd.c b/networking/ftpd.c index 70a353312..9937cc3ea 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -630,7 +630,7 @@ popen_ls(const char *opt) | |||
630 | cwd = xrealloc_getcwd_or_warn(NULL); | 630 | cwd = xrealloc_getcwd_or_warn(NULL); |
631 | xpiped_pair(outfd); | 631 | xpiped_pair(outfd); |
632 | 632 | ||
633 | /*fflush(NULL); - so far we dont use stdio on output */ | 633 | /*fflush_all(); - so far we dont use stdio on output */ |
634 | pid = BB_MMU ? fork() : vfork(); | 634 | pid = BB_MMU ? fork() : vfork(); |
635 | if (pid < 0) | 635 | if (pid < 0) |
636 | bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork"); | 636 | bb_perror_msg_and_die(BB_MMU ? "fork" : "vfork"); |
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index d0c5cce07..88d1944da 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -969,7 +969,7 @@ static int doit(char *str) | |||
969 | pid_t child; | 969 | pid_t child; |
970 | int status; | 970 | int status; |
971 | 971 | ||
972 | fflush(NULL); | 972 | fflush_all(); |
973 | child = vfork(); | 973 | child = vfork(); |
974 | switch (child) { | 974 | switch (child) { |
975 | case -1: /* failure */ | 975 | case -1: /* failure */ |
@@ -1038,7 +1038,7 @@ static int popen2(FILE **in, FILE **out, char *command, char *param) | |||
1038 | xpiped_pair(infd); | 1038 | xpiped_pair(infd); |
1039 | xpiped_pair(outfd); | 1039 | xpiped_pair(outfd); |
1040 | 1040 | ||
1041 | fflush(NULL); | 1041 | fflush_all(); |
1042 | pid = vfork(); | 1042 | pid = vfork(); |
1043 | 1043 | ||
1044 | switch (pid) { | 1044 | switch (pid) { |
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 86d27548b..fcf9623e4 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -182,7 +182,7 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n) | |||
182 | } | 182 | } |
183 | } | 183 | } |
184 | bb_putchar('\n'); | 184 | bb_putchar('\n'); |
185 | /*fflush(stdout);*/ | 185 | /*fflush_all();*/ |
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | 188 | ||
@@ -344,7 +344,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, | |||
344 | printf(" %s", buf); | 344 | printf(" %s", buf); |
345 | } | 345 | } |
346 | bb_putchar('\n'); | 346 | bb_putchar('\n'); |
347 | /*fflush(stdout);*/ | 347 | /*fflush_all();*/ |
348 | return 0; | 348 | return 0; |
349 | } | 349 | } |
350 | 350 | ||
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index e52473117..659f3a9f0 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c | |||
@@ -151,7 +151,7 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, | |||
151 | fputs(rtnl_rtntype_n2a(r->rtm_type, b1), stdout); | 151 | fputs(rtnl_rtntype_n2a(r->rtm_type, b1), stdout); |
152 | 152 | ||
153 | bb_putchar('\n'); | 153 | bb_putchar('\n'); |
154 | /*fflush(stdout);*/ | 154 | /*fflush_all();*/ |
155 | return 0; | 155 | return 0; |
156 | } | 156 | } |
157 | 157 | ||
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index 9aaeec100..ad98bed30 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c | |||
@@ -152,7 +152,7 @@ enum { | |||
152 | /* Debug: squirt whatever message and sleep a bit so we can see it go by. */ | 152 | /* Debug: squirt whatever message and sleep a bit so we can see it go by. */ |
153 | /* Beware: writes to stdOUT... */ | 153 | /* Beware: writes to stdOUT... */ |
154 | #if 0 | 154 | #if 0 |
155 | #define Debug(...) do { printf(__VA_ARGS__); printf("\n"); fflush(stdout); sleep(1); } while (0) | 155 | #define Debug(...) do { printf(__VA_ARGS__); printf("\n"); fflush_all(); sleep(1); } while (0) |
156 | #else | 156 | #else |
157 | #define Debug(...) do { } while (0) | 157 | #define Debug(...) do { } while (0) |
158 | #endif | 158 | #endif |
diff --git a/networking/ping.c b/networking/ping.c index 71b2a4be8..d30eb5cfa 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -491,7 +491,7 @@ static void unpack_tail(int sz, uint32_t *tp, | |||
491 | if (tp) | 491 | if (tp) |
492 | printf(" time=%u.%03u ms", triptime / 1000, triptime % 1000); | 492 | printf(" time=%u.%03u ms", triptime / 1000, triptime % 1000); |
493 | puts(dupmsg); | 493 | puts(dupmsg); |
494 | fflush(stdout); | 494 | fflush_all(); |
495 | } | 495 | } |
496 | static void unpack4(char *buf, int sz, struct sockaddr_in *from) | 496 | static void unpack4(char *buf, int sz, struct sockaddr_in *from) |
497 | { | 497 | { |
diff --git a/networking/telnetd.c b/networking/telnetd.c index 163efaa42..b0a1cc4d8 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -288,7 +288,7 @@ make_new_session( | |||
288 | /*ts->size2 = 0;*/ | 288 | /*ts->size2 = 0;*/ |
289 | } | 289 | } |
290 | 290 | ||
291 | fflush(NULL); /* flush all streams */ | 291 | fflush_all(); |
292 | pid = vfork(); /* NOMMU-friendly */ | 292 | pid = vfork(); /* NOMMU-friendly */ |
293 | if (pid < 0) { | 293 | if (pid < 0) { |
294 | free(ts); | 294 | free(ts); |
@@ -331,7 +331,7 @@ make_new_session( | |||
331 | /*termbuf.c_lflag &= ~ICANON;*/ | 331 | /*termbuf.c_lflag &= ~ICANON;*/ |
332 | tcsetattr_stdin_TCSANOW(&termbuf); | 332 | tcsetattr_stdin_TCSANOW(&termbuf); |
333 | 333 | ||
334 | /* Uses FILE-based I/O to stdout, but does fflush(stdout), | 334 | /* Uses FILE-based I/O to stdout, but does fflush_all(), |
335 | * so should be safe with vfork. | 335 | * so should be safe with vfork. |
336 | * I fear, though, that some users will have ridiculously big | 336 | * I fear, though, that some users will have ridiculously big |
337 | * issue files, and they may block writing to fd 1, | 337 | * issue files, and they may block writing to fd 1, |
diff --git a/networking/traceroute.c b/networking/traceroute.c index 7284f0022..fa45db98a 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -815,7 +815,7 @@ int traceroute_main(int argc, char **argv) | |||
815 | 815 | ||
816 | if (!first && pausemsecs > 0) | 816 | if (!first && pausemsecs > 0) |
817 | usleep(pausemsecs * 1000); | 817 | usleep(pausemsecs * 1000); |
818 | fflush(stdout); | 818 | fflush_all(); |
819 | 819 | ||
820 | t1 = monotonic_us(); | 820 | t1 = monotonic_us(); |
821 | send_probe(++seq, ttl); | 821 | send_probe(++seq, ttl); |