diff options
author | Rob Landley | 2006-08-22 23:50:11 +0000 |
---|---|---|
committer | Rob Landley | 2006-08-22 23:50:11 +0000 |
commit | 4b5827a69b85dbd931d989ac2a652348e59d876c (patch) | |
tree | 7113dad57629f4dc763cad249b69b1f956b753d1 /modutils | |
parent | ecb29573e9d2caf59de17fcb4efff129b35ad792 (diff) | |
download | busybox-4b5827a69b85dbd931d989ac2a652348e59d876c.zip busybox-4b5827a69b85dbd931d989ac2a652348e59d876c.tar.gz |
Patch from Yann Morin so modprobe won't return failure if the module gets
loaded while it's running (ala multi-device hotplug).
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/modprobe.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index efb119e..f51de56 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -679,7 +679,7 @@ static int mod_process ( struct mod_list_t *list, int do_insert ) } if (!show_only) { int rc2 = wait4pid(spawn(argv)); - + if (do_insert) { rc = rc2; /* only last module matters */ } @@ -859,7 +859,16 @@ static int mod_insert ( char *mod, int argc, char **argv ) } // process tail ---> head - rc = mod_process ( tail, 1 ); + if ((rc = mod_process ( tail, 1 )) != 0) { + /* + * In case of using udev, multiple instances of modprobe can be + * spawned to load the same module (think of two same usb devices, + * for example; or cold-plugging at boot time). Thus we shouldn't + * fail if the module was loaded, and not by us. + */ + if (already_loaded (mod) ) + rc = 0; + } } else rc = 1; |