diff options
author | Glenn L McGrath | 2003-09-02 02:36:18 +0000 |
---|---|---|
committer | Glenn L McGrath | 2003-09-02 02:36:18 +0000 |
commit | dc4e75ef7ca135c836d22e380847672cf5b3773b (patch) | |
tree | d2ff4fef7b9192de63761935103699569ecbb2ee /init | |
parent | 005f83adf511ab89296639abbef737ad4e5826f9 (diff) | |
download | busybox-dc4e75ef7ca135c836d22e380847672cf5b3773b.zip busybox-dc4e75ef7ca135c836d22e380847672cf5b3773b.tar.gz |
move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/init/init.c b/init/init.c index e52517e..2f44e13 100644 --- a/init/init.c +++ b/init/init.c @@ -104,8 +104,6 @@ struct serial_struct { #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 int RB_AUTOBOOT = 0x01234567; static const char * const environment[] = { "HOME=/", "PATH=" _PATH_STDPATH, - "SHELL=" SHELL, + "SHELL=/bin/sh", "USER=root", NULL }; @@ -526,7 +524,7 @@ static pid_t run(const struct init_action *a) /* 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 @@ static void child_handler(int sig) #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 @@ static void parse_inittab(void) /* 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 @@ extern int init_main(int argc, char **argv) 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 */ |