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 /shell/ash.c | |
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 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/shell/ash.c b/shell/ash.c index 481b84138..6b985ad7c 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -389,16 +389,7 @@ static void | |||
389 | flush_stdout_stderr(void) | 389 | flush_stdout_stderr(void) |
390 | { | 390 | { |
391 | INT_OFF; | 391 | INT_OFF; |
392 | fflush(stdout); | 392 | fflush_all(); |
393 | fflush(stderr); | ||
394 | INT_ON; | ||
395 | } | ||
396 | |||
397 | static void | ||
398 | flush_stderr(void) | ||
399 | { | ||
400 | INT_OFF; | ||
401 | fflush(stderr); | ||
402 | INT_ON; | 393 | INT_ON; |
403 | } | 394 | } |
404 | 395 | ||
@@ -451,7 +442,7 @@ static void | |||
451 | out2str(const char *p) | 442 | out2str(const char *p) |
452 | { | 443 | { |
453 | outstr(p, stderr); | 444 | outstr(p, stderr); |
454 | flush_stderr(); | 445 | flush_stdout_stderr(); |
455 | } | 446 | } |
456 | 447 | ||
457 | 448 | ||
@@ -8184,7 +8175,7 @@ evaltree(union node *n, int flags) | |||
8184 | default: | 8175 | default: |
8185 | #if DEBUG | 8176 | #if DEBUG |
8186 | out1fmt("Node type = %d\n", n->type); | 8177 | out1fmt("Node type = %d\n", n->type); |
8187 | fflush(stdout); | 8178 | fflush_all(); |
8188 | break; | 8179 | break; |
8189 | #endif | 8180 | #endif |
8190 | case NNOT: | 8181 | case NNOT: |
@@ -9101,7 +9092,7 @@ evalcommand(union node *cmd, int flags) | |||
9101 | for (;;) { | 9092 | for (;;) { |
9102 | find_command(argv[0], &cmdentry, cmd_flag, path); | 9093 | find_command(argv[0], &cmdentry, cmd_flag, path); |
9103 | if (cmdentry.cmdtype == CMDUNKNOWN) { | 9094 | if (cmdentry.cmdtype == CMDUNKNOWN) { |
9104 | flush_stderr(); | 9095 | flush_stdout_stderr(); |
9105 | status = 127; | 9096 | status = 127; |
9106 | goto bail; | 9097 | goto bail; |
9107 | } | 9098 | } |