}
if (!show_only) {
int rc2 = wait4pid(spawn(argv));
-
+
if (do_insert) {
rc = rc2; /* only last module matters */
}
}
// 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;