aboutsummaryrefslogtreecommitdiff
path: root/coreutils/echo.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-11-24 02:23:51 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-11-24 02:23:51 +0000
commitfe5e23bf75043302a3492c9a7cd2f30f20f51b2e (patch)
treec6d5a70e6430755a0e20c682c090dfbedbd254ce /coreutils/echo.c
parentc3c6659f12e4133054ae4a6708fc4ac299c0d098 (diff)
downloadbusybox-fe5e23bf75043302a3492c9a7cd2f30f20f51b2e.tar.gz
remove echo_main -> bb_echo indirection
Diffstat (limited to 'coreutils/echo.c')
-rw-r--r--coreutils/echo.c20
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 @@
#include "libbb.h"
+/* This is a NOFORK applet. Be very careful! */
+
/* argc is unused, but removing it precludes compiler from
* using call -> jump optimization */
-int bb_echo(int argc, char **argv)
+
+int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int echo_main(int argc, char **argv)
{
const char *arg;
#if !ENABLE_FEATURE_FANCY_ECHO
@@ -38,7 +42,7 @@ int bb_echo(int argc, char **argv)
/* We must check that stdout is not closed.
* The reason for this is highly non-obvious.
- * bb_echo is used from shell. Shell must correctly handle "echo foo"
+ * echo_main is used from shell. Shell must correctly handle "echo foo"
* if stdout is closed. With stdio, output gets shoveled into
* stdout buffer, and even fflush cannot clear it out. It seems that
* even if libc receives EBADF on write attempts, it feels determined
@@ -135,14 +139,6 @@ int bb_echo(int argc, char **argv)
return fflush(stdout);
}
-/* This is a NOFORK applet. Be very careful! */
-
-int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int echo_main(int argc, char **argv)
-{
- return bb_echo(argc, argv);
-}
-
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -185,7 +181,7 @@ int echo_main(int argc, char **argv)
#ifdef VERSION_WITH_WRITEV
/* We can't use stdio.
* The reason for this is highly non-obvious.
- * bb_echo is used from shell. Shell must correctly handle "echo foo"
+ * echo_main is used from shell. Shell must correctly handle "echo foo"
* if stdout is closed. With stdio, output gets shoveled into
* stdout buffer, and even fflush cannot clear it out. It seems that
* even if libc receives EBADF on write attempts, it feels determined
@@ -195,7 +191,7 @@ int echo_main(int argc, char **argv)
* Using writev instead, with 'direct' conversion of argv vector.
*/
-int bb_echo(int argc, char **argv)
+int echo_main(int argc, char **argv)
{
struct iovec io[argc];
struct iovec *cur_io = io;