summaryrefslogtreecommitdiff
path: root/networking/ifupdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r--networking/ifupdown.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index c7b560b..7706a84 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -106,6 +106,7 @@ enum {
struct globals {
char **my_environ;
const char *startup_PATH;
+ char *shell;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() do { } while (0)
@@ -986,11 +987,10 @@ static int doit(char *str)
fflush_all();
child = vfork();
- switch (child) {
- case -1: /* failure */
+ if (child < 0) /* failure */
return 0;
- case 0: /* child */
- execle(DEFAULT_SHELL, DEFAULT_SHELL, "-c", str, (char *) NULL, G.my_environ);
+ if (child == 0) { /* child */
+ execle(G.shell, G.shell, "-c", str, (char *) NULL, G.my_environ);
_exit(127);
}
safe_waitpid(child, &status, 0);
@@ -1165,6 +1165,7 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv)
INIT_G();
G.startup_PATH = getenv("PATH");
+ G.shell = xstrdup(get_shell_name());
cmds = iface_down;
if (applet_name[2] == 'u') {