svn commit: trunk/busybox: coreutils include shell

vda at busybox.net vda at busybox.net
Sat Nov 24 02:23:52 UTC 2007


Author: vda
Date: 2007-11-23 18:23:51 -0800 (Fri, 23 Nov 2007)
New Revision: 20520

Log:
remove echo_main -> bb_echo indirection



Modified:
   trunk/busybox/coreutils/echo.c
   trunk/busybox/include/libbb.h
   trunk/busybox/shell/ash.c
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/coreutils/echo.c
===================================================================
--- trunk/busybox/coreutils/echo.c	2007-11-24 00:22:42 UTC (rev 20519)
+++ trunk/busybox/coreutils/echo.c	2007-11-24 02:23:51 UTC (rev 20520)
@@ -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 @@
 
 	/* 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 @@
 	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 @@
 #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 @@
  * 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;

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2007-11-24 00:22:42 UTC (rev 20519)
+++ trunk/busybox/include/libbb.h	2007-11-24 02:23:51 UTC (rev 20520)
@@ -728,7 +728,7 @@
 
 /* applets which are useful from another applets */
 int bb_cat(char** argv);
-int bb_echo(int argc, char** argv);
+int echo_main(int argc, char** argv) MAIN_EXTERNALLY_VISIBLE;
 int test_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int kill_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 #if ENABLE_ROUTE

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2007-11-24 00:22:42 UTC (rev 20519)
+++ trunk/busybox/shell/ash.c	2007-11-24 02:23:51 UTC (rev 20520)
@@ -11003,7 +11003,7 @@
 static int
 echocmd(int argc, char **argv)
 {
-	return bb_echo(argc, argv);
+	return echo_main(argc, argv);
 }
 #endif
 

Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2007-11-24 00:22:42 UTC (rev 20519)
+++ trunk/busybox/shell/hush.c	2007-11-24 02:23:51 UTC (rev 20520)
@@ -853,7 +853,7 @@
 		argc++;
 		argv++;
 	}
-	return bb_echo(argc, argv - argc);
+	return echo_main(argc, argv - argc);
 }
 
 /* built-in 'eval' handler */




More information about the busybox-cvs mailing list