diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-24 02:23:51 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-24 02:23:51 +0000 |
commit | fe5e23bf75043302a3492c9a7cd2f30f20f51b2e (patch) | |
tree | c6d5a70e6430755a0e20c682c090dfbedbd254ce /coreutils | |
parent | c3c6659f12e4133054ae4a6708fc4ac299c0d098 (diff) | |
download | busybox-w32-fe5e23bf75043302a3492c9a7cd2f30f20f51b2e.tar.gz busybox-w32-fe5e23bf75043302a3492c9a7cd2f30f20f51b2e.tar.bz2 busybox-w32-fe5e23bf75043302a3492c9a7cd2f30f20f51b2e.zip |
remove echo_main -> bb_echo indirection
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/echo.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/coreutils/echo.c b/coreutils/echo.c index 4c7a91743..e39b466c0 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -25,9 +25,13 @@ | |||
25 | 25 | ||
26 | #include "libbb.h" | 26 | #include "libbb.h" |
27 | 27 | ||
28 | /* This is a NOFORK applet. Be very careful! */ | ||
29 | |||
28 | /* argc is unused, but removing it precludes compiler from | 30 | /* argc is unused, but removing it precludes compiler from |
29 | * using call -> jump optimization */ | 31 | * using call -> jump optimization */ |
30 | int bb_echo(int argc, char **argv) | 32 | |
33 | int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | ||
34 | int echo_main(int argc, char **argv) | ||
31 | { | 35 | { |
32 | const char *arg; | 36 | const char *arg; |
33 | #if !ENABLE_FEATURE_FANCY_ECHO | 37 | #if !ENABLE_FEATURE_FANCY_ECHO |
@@ -38,7 +42,7 @@ int bb_echo(int argc, char **argv) | |||
38 | 42 | ||
39 | /* We must check that stdout is not closed. | 43 | /* We must check that stdout is not closed. |
40 | * The reason for this is highly non-obvious. | 44 | * The reason for this is highly non-obvious. |
41 | * bb_echo is used from shell. Shell must correctly handle "echo foo" | 45 | * echo_main is used from shell. Shell must correctly handle "echo foo" |
42 | * if stdout is closed. With stdio, output gets shoveled into | 46 | * if stdout is closed. With stdio, output gets shoveled into |
43 | * stdout buffer, and even fflush cannot clear it out. It seems that | 47 | * stdout buffer, and even fflush cannot clear it out. It seems that |
44 | * even if libc receives EBADF on write attempts, it feels determined | 48 | * even if libc receives EBADF on write attempts, it feels determined |
@@ -135,14 +139,6 @@ int bb_echo(int argc, char **argv) | |||
135 | return fflush(stdout); | 139 | return fflush(stdout); |
136 | } | 140 | } |
137 | 141 | ||
138 | /* This is a NOFORK applet. Be very careful! */ | ||
139 | |||
140 | int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | ||
141 | int echo_main(int argc, char **argv) | ||
142 | { | ||
143 | return bb_echo(argc, argv); | ||
144 | } | ||
145 | |||
146 | /*- | 142 | /*- |
147 | * Copyright (c) 1991, 1993 | 143 | * Copyright (c) 1991, 1993 |
148 | * The Regents of the University of California. All rights reserved. | 144 | * The Regents of the University of California. All rights reserved. |
@@ -185,7 +181,7 @@ int echo_main(int argc, char **argv) | |||
185 | #ifdef VERSION_WITH_WRITEV | 181 | #ifdef VERSION_WITH_WRITEV |
186 | /* We can't use stdio. | 182 | /* We can't use stdio. |
187 | * The reason for this is highly non-obvious. | 183 | * The reason for this is highly non-obvious. |
188 | * bb_echo is used from shell. Shell must correctly handle "echo foo" | 184 | * echo_main is used from shell. Shell must correctly handle "echo foo" |
189 | * if stdout is closed. With stdio, output gets shoveled into | 185 | * if stdout is closed. With stdio, output gets shoveled into |
190 | * stdout buffer, and even fflush cannot clear it out. It seems that | 186 | * stdout buffer, and even fflush cannot clear it out. It seems that |
191 | * even if libc receives EBADF on write attempts, it feels determined | 187 | * even if libc receives EBADF on write attempts, it feels determined |
@@ -195,7 +191,7 @@ int echo_main(int argc, char **argv) | |||
195 | * Using writev instead, with 'direct' conversion of argv vector. | 191 | * Using writev instead, with 'direct' conversion of argv vector. |
196 | */ | 192 | */ |
197 | 193 | ||
198 | int bb_echo(int argc, char **argv) | 194 | int echo_main(int argc, char **argv) |
199 | { | 195 | { |
200 | struct iovec io[argc]; | 196 | struct iovec io[argc]; |
201 | struct iovec *cur_io = io; | 197 | struct iovec *cur_io = io; |