aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-22 23:50:11 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-22 23:50:11 +0000
commitd16ebb5aa9a119f7e592f4c556f78130182a4644 (patch)
tree7113dad57629f4dc763cad249b69b1f956b753d1
parentf614e45aaaf139b89cd02505c5aed3278350e305 (diff)
downloadbusybox-w32-d16ebb5aa9a119f7e592f4c556f78130182a4644.tar.gz
busybox-w32-d16ebb5aa9a119f7e592f4c556f78130182a4644.tar.bz2
busybox-w32-d16ebb5aa9a119f7e592f4c556f78130182a4644.zip
Patch from Yann Morin so modprobe won't return failure if the module gets
loaded while it's running (ala multi-device hotplug). git-svn-id: svn://busybox.net/trunk/busybox@15906 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--modutils/modprobe.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index efb119e3e..f51de56be 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 )
679 } 679 }
680 if (!show_only) { 680 if (!show_only) {
681 int rc2 = wait4pid(spawn(argv)); 681 int rc2 = wait4pid(spawn(argv));
682 682
683 if (do_insert) { 683 if (do_insert) {
684 rc = rc2; /* only last module matters */ 684 rc = rc2; /* only last module matters */
685 } 685 }
@@ -859,7 +859,16 @@ static int mod_insert ( char *mod, int argc, char **argv )
859 } 859 }
860 860
861 // process tail ---> head 861 // process tail ---> head
862 rc = mod_process ( tail, 1 ); 862 if ((rc = mod_process ( tail, 1 )) != 0) {
863 /*
864 * In case of using udev, multiple instances of modprobe can be
865 * spawned to load the same module (think of two same usb devices,
866 * for example; or cold-plugging at boot time). Thus we shouldn't
867 * fail if the module was loaded, and not by us.
868 */
869 if (already_loaded (mod) )
870 rc = 0;
871 }
863 } 872 }
864 else 873 else
865 rc = 1; 874 rc = 1;