static struct kobject *base_probe(dev_t dev, int *part, void *data)
{
- request_module("block-major-%d", MAJOR(dev));
+ if (request_module("block-major-%d-%d", MAJOR(dev), MINOR(dev)) > 0)
+ /* Make old-style 2.4 aliases work */
+ request_module("block-major-%d", MAJOR(dev));
return NULL;
}
static struct kobject *base_probe(dev_t dev, int *part, void *data)
{
- request_module("char-major-%d-%d", MAJOR(dev), MINOR(dev));
+ if (request_module("char-major-%d-%d", MAJOR(dev), MINOR(dev)) > 0)
+ /* Make old-style 2.4 aliases work */
+ request_module("char-major-%d", MAJOR(dev));
return NULL;
}
#include <linux/compiler.h>
#ifdef CONFIG_KMOD
+/* modprobe exit status on success, -ve on error. Return value
+ * usually useless though. */
extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2)));
#else
static inline int request_module(const char * name, ...) { return -ENOSYS; }
{
struct subprocess_info *sub_info = data;
pid_t pid;
+ struct k_sigaction sa;
+
+ /* Install a handler: if SIGCLD isn't handled sys_wait4 won't
+ * populate the status, but will return -ECHILD. */
+ sa.sa.sa_handler = SIG_IGN;
+ sa.sa.sa_flags = 0;
+ siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
+ do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
+ allow_signal(SIGCHLD);
- sub_info->retval = 0;
pid = kernel_thread(____call_usermodehelper, sub_info, SIGCHLD);
if (pid < 0)
sub_info->retval = pid;
else
- /* 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);
+ sys_wait4(pid, &sub_info->retval, 0, NULL);
complete(sub_info->complete);
return 0;
* until that is done. */
if (sub_info->wait)
pid = kernel_thread(wait_for_helper, sub_info,
- CLONE_KERNEL | SIGCHLD);
+ CLONE_FS | CLONE_FILES | SIGCHLD);
else
pid = kernel_thread(____call_usermodehelper, sub_info,
CLONE_VFORK | SIGCHLD);