summaryrefslogtreecommitdiff
path: root/kernel/kmod.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-06-20 08:15:08 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-20 08:15:08 -0700
commitbcb421eab9e1df9ddfbff4860a3f79f4735d2b93 (patch)
tree53eff7bd62db6c90c45f98fc0e7301690affe33f /kernel/kmod.c
parentbf93adba773ef299b536db4f2a9b11fc4c217522 (diff)
[PATCH] Fix kmod return value
From: Rusty Russell <rusty@rustcorp.com.au> Milton Miller <miltonm@bga.com> and Junfeng Yang <yjf@stanford.edu> point out that we hand a kernel address to sys_wait4 for the status pointer. This is true, but since we don't have a SIGCHLD handler, it never gets that far. Use NULL, and document the fact.
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r--kernel/kmod.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c
index d9e4299a8765..e011611afb7d 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -183,12 +183,15 @@ static int wait_for_helper(void *data)
struct subprocess_info *sub_info = data;
pid_t pid;
- pid = kernel_thread(____call_usermodehelper, sub_info,
- CLONE_VFORK | SIGCHLD);
+ sub_info->retval = 0;
+ pid = kernel_thread(____call_usermodehelper, sub_info, SIGCHLD);
if (pid < 0)
sub_info->retval = pid;
else
- sys_wait4(pid, (unsigned int *)&sub_info->retval, 0, NULL);
+ /* We don't have a SIGCHLD signal handler, so this
+ * always returns -ECHILD, but the important thing is
+ * that it blocks. */
+ sys_wait4(pid, NULL, 0, NULL);
complete(sub_info->complete);
return 0;
@@ -231,8 +234,7 @@ static void __call_usermodehelper(void *data)
* (ie. it runs with full root capabilities).
*
* Must be called from process context. Returns a negative error code
- * if program was not execed successfully, or (exitcode << 8 + signal)
- * of the application (0 if wait is not set).
+ * if program was not execed successfully, or 0.
*/
int call_usermodehelper(char *path, char **argv, char **envp, int wait)
{