diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
commit | 482368b1a8e45430672c58c9a42e7d2004367126 (patch) | |
tree | ce2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /kernel/kmod.c | |
parent | e4d0251c6f56ab2e191afb70f80f382793e23f74 (diff) |
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r-- | kernel/kmod.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 22c7509a8..dca806e94 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -63,10 +63,8 @@ use_init_fs_context(void) unlock_kernel(); } -static int exec_modprobe(void * module_name) +int exec_usermodehelper(char *program_path, char *argv[], char *envp[]) { - static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; - char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL }; int i; current->session = 1; @@ -101,13 +99,24 @@ static int exec_modprobe(void * module_name) set_fs(KERNEL_DS); /* Go, go, go... */ - if (execve(modprobe_path, argv, envp) < 0) { + if (execve(program_path, argv, envp) < 0) + return -errno; + return 0; +} + +static int exec_modprobe(void * module_name) +{ + static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; + char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL }; + int ret; + + ret = exec_usermodehelper(modprobe_path, argv, envp); + if (ret) { printk(KERN_ERR "kmod: failed to exec %s -s -k %s, errno = %d\n", modprobe_path, (char*) module_name, errno); - return -errno; } - return 0; + return ret; } /* |