[BusyBox-cvs] busybox/init init.c,1.193,1.194

Glenn McGrath bug1 at busybox.net
Tue Sep 2 02:36:13 UTC 2003


Update of /var/cvs/busybox/init
In directory winder:/tmp/cvs-serv18900/init

Modified Files:
	init.c 
Log Message:
move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107


Index: init.c
===================================================================
RCS file: /var/cvs/busybox/init/init.c,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- init.c	26 Aug 2003 02:14:58 -0000	1.193
+++ init.c	2 Sep 2003 02:36:10 -0000	1.194
@@ -104,8 +104,6 @@
 
 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
 
-#define SHELL        "/bin/sh"	/* Default shell */
-#define LOGIN_SHELL  "-" SHELL	/* Default login shell */
 #define INITTAB      "/etc/inittab"	/* inittab file location */
 #ifndef INIT_SCRIPT
 #define INIT_SCRIPT  "/etc/init.d/rcS"	/* Default sysinit script. */
@@ -180,7 +178,7 @@
 static const char * const environment[] = {
 	"HOME=/",
 	"PATH=" _PATH_STDPATH,
-	"SHELL=" SHELL,
+	"SHELL=/bin/sh",
 	"USER=root",
 	NULL
 };
@@ -526,7 +524,7 @@
 
 		/* See if any special /bin/sh requiring characters are present */
 		if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
-			cmd[0] = SHELL;
+			cmd[0] = (char *)DEFAULT_SHELL;
 			cmd[1] = "-c";
 			cmd[2] = strcat(strcpy(buf, "exec "), a->command);
 			cmd[3] = NULL;
@@ -840,7 +838,7 @@
 
 #endif							/* ! DEBUG_INIT */
 
-static void new_init_action(int action, char *command, const char *cons)
+static void new_init_action(int action, const char *command, const char *cons)
 {
 	struct init_action *new_action, *a;
 
@@ -960,10 +958,10 @@
 		/* Prepare to restart init when a HUP is received */
 		new_init_action(RESTART, "/sbin/init", "");
 		/* Askfirst shell on tty1-4 */
-		new_init_action(ASKFIRST, LOGIN_SHELL, "");
-		new_init_action(ASKFIRST, LOGIN_SHELL, VC_2);
-		new_init_action(ASKFIRST, LOGIN_SHELL, VC_3);
-		new_init_action(ASKFIRST, LOGIN_SHELL, VC_4);
+		new_init_action(ASKFIRST, bb_default_login_shell, "");
+		new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
+		new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
+		new_init_action(ASKFIRST, bb_default_login_shell, VC_4);
 		/* sysinit */
 		new_init_action(SYSINIT, INIT_SCRIPT, "");
 
@@ -1116,7 +1114,7 @@
 	if (argc > 1 && (!strcmp(argv[1], "single") ||
 					 !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) {
 		/* Start a shell on console */
-		new_init_action(RESPAWN, LOGIN_SHELL, "");
+		new_init_action(RESPAWN, bb_default_login_shell, "");
 	} else {
 		/* Not in single user mode -- see what inittab says */
 




More information about the busybox-cvs mailing list