aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-14 01:24:33 +0000
committerRob Landley <rob@landley.net>2006-06-14 01:24:33 +0000
commitc7ddefc0624173de6b74ee5b5b39cb2d354f5ae6 (patch)
tree2e4ef7885c2e1d5cc436e9014207f2f05e86888d /modutils
parent575c8bacdaa0dd9f0f25719ec83ae505fbd3c382 (diff)
downloadbusybox-c7ddefc0624173de6b74ee5b5b39cb2d354f5ae6.tar.gz
Attempt at fixing bug 815 by upgrading bb_spawn() so that builtins are at
the start of the path. (This should be under the same config option as the standalone shell, but right now that's buried in the shell menu.) Also add the ability to specify CONFIG_BUSYBOX_EXEC_PATH with /proc/self/exe as an overrideable default.
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 93e510293..698eed84a 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -666,27 +666,8 @@ static int mod_process ( struct mod_list_t *list, int do_insert )
printf("%s module %s\n", do_insert?"Loading":"Unloading", list-> m_name );
}
if (!show_only) {
- int rc2 = 0;
- int status;
- switch (fork()) {
- case -1:
- rc2 = 1;
- break;
- case 0: //child
- execvp(argv[0], argv);
- bb_perror_msg_and_die("exec of %s", argv[0]);
- /* NOTREACHED */
- default:
- if (wait(&status) == -1) {
- rc2 = 1;
- break;
- }
- if (WIFEXITED(status))
- rc2 = WEXITSTATUS(status);
- if (WIFSIGNALED(status))
- rc2 = WTERMSIG(status);
- break;
- }
+ int rc2 = wait4pid(bb_spawn(argv));
+
if (do_insert) {
rc = rc2; /* only last module matters */
}