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/hush.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/hush.c')
-rw-r--r-- | shell/hush.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/shell/hush.c b/shell/hush.c index 1187cbe8f..891d87be7 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1206,7 +1206,7 @@ static void hush_exit(int exitcode) | |||
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | #if ENABLE_HUSH_JOB | 1208 | #if ENABLE_HUSH_JOB |
1209 | fflush(NULL); /* flush all streams */ | 1209 | fflush_all(); |
1210 | sigexit(- (exitcode & 0xff)); | 1210 | sigexit(- (exitcode & 0xff)); |
1211 | #else | 1211 | #else |
1212 | exit(exitcode); | 1212 | exit(exitcode); |
@@ -1679,7 +1679,7 @@ static void get_user_input(struct in_str *i) | |||
1679 | do { | 1679 | do { |
1680 | G.flag_SIGINT = 0; | 1680 | G.flag_SIGINT = 0; |
1681 | fputs(prompt_str, stdout); | 1681 | fputs(prompt_str, stdout); |
1682 | fflush(stdout); | 1682 | fflush_all(); |
1683 | G.user_input_buf[0] = r = fgetc(i->file); | 1683 | G.user_input_buf[0] = r = fgetc(i->file); |
1684 | /*G.user_input_buf[1] = '\0'; - already is and never changed */ | 1684 | /*G.user_input_buf[1] = '\0'; - already is and never changed */ |
1685 | //do we need check_and_run_traps(0)? (maybe only if stdin) | 1685 | //do we need check_and_run_traps(0)? (maybe only if stdin) |
@@ -3220,7 +3220,7 @@ static void exec_function(char ***to_free, | |||
3220 | G.global_argc = n; | 3220 | G.global_argc = n; |
3221 | /* On MMU, funcp->body is always non-NULL */ | 3221 | /* On MMU, funcp->body is always non-NULL */ |
3222 | n = run_list(funcp->body); | 3222 | n = run_list(funcp->body); |
3223 | fflush(NULL); | 3223 | fflush_all(); |
3224 | _exit(n); | 3224 | _exit(n); |
3225 | # else | 3225 | # else |
3226 | re_execute_shell(to_free, | 3226 | re_execute_shell(to_free, |
@@ -3307,7 +3307,7 @@ static void exec_builtin(char ***to_free, | |||
3307 | { | 3307 | { |
3308 | #if BB_MMU | 3308 | #if BB_MMU |
3309 | int rcode = x->function(argv); | 3309 | int rcode = x->function(argv); |
3310 | fflush(NULL); | 3310 | fflush_all(); |
3311 | _exit(rcode); | 3311 | _exit(rcode); |
3312 | #else | 3312 | #else |
3313 | /* On NOMMU, we must never block! | 3313 | /* On NOMMU, we must never block! |
@@ -3933,7 +3933,7 @@ static NOINLINE int run_pipe(struct pipe *pi) | |||
3933 | debug_printf_exec(": builtin '%s' '%s'...\n", | 3933 | debug_printf_exec(": builtin '%s' '%s'...\n", |
3934 | x->cmd, argv_expanded[1]); | 3934 | x->cmd, argv_expanded[1]); |
3935 | rcode = x->function(argv_expanded) & 0xff; | 3935 | rcode = x->function(argv_expanded) & 0xff; |
3936 | fflush(NULL); | 3936 | fflush_all(); |
3937 | } | 3937 | } |
3938 | #if ENABLE_HUSH_FUNCTIONS | 3938 | #if ENABLE_HUSH_FUNCTIONS |
3939 | else { | 3939 | else { |
@@ -7136,7 +7136,7 @@ static int FAST_FUNC builtin_export(char **argv) | |||
7136 | putchar('\n'); | 7136 | putchar('\n'); |
7137 | #endif | 7137 | #endif |
7138 | } | 7138 | } |
7139 | /*fflush(stdout); - done after each builtin anyway */ | 7139 | /*fflush_all(); - done after each builtin anyway */ |
7140 | } | 7140 | } |
7141 | return EXIT_SUCCESS; | 7141 | return EXIT_SUCCESS; |
7142 | } | 7142 | } |
@@ -7181,7 +7181,7 @@ static int FAST_FUNC builtin_trap(char **argv) | |||
7181 | printf(" %s\n", get_signame(i)); | 7181 | printf(" %s\n", get_signame(i)); |
7182 | } | 7182 | } |
7183 | } | 7183 | } |
7184 | /*fflush(stdout); - done after each builtin anyway */ | 7184 | /*fflush_all(); - done after each builtin anyway */ |
7185 | return EXIT_SUCCESS; | 7185 | return EXIT_SUCCESS; |
7186 | } | 7186 | } |
7187 | 7187 | ||