diff options
-rw-r--r-- | modutils/modprobe.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index ddf63ab70..5d6c8f3ce 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -426,14 +426,20 @@ static int mod_process ( struct mod_list_t *list, int do_insert ) | |||
426 | do_syslog ? "-s" : "", list-> m_module ); | 426 | do_syslog ? "-s" : "", list-> m_module ); |
427 | } | 427 | } |
428 | 428 | ||
429 | if ( verbose ) | 429 | if (*lcmd) { |
430 | printf ( "%s\n", lcmd ); | 430 | if (verbose) { |
431 | if ( !show_only && *lcmd) { | 431 | printf("%s\n", lcmd); |
432 | int rc2 = system ( lcmd ); | 432 | } |
433 | if (do_insert) rc = rc2; /* only last module matters */ | 433 | if (!show_only) { |
434 | else if (!rc2) rc = 0; /* success if remove any mod */ | 434 | int rc2 = system(lcmd); |
435 | if (do_insert) { | ||
436 | rc = rc2; /* only last module matters */ | ||
437 | } | ||
438 | else if (!rc2) { | ||
439 | rc = 0; /* success if remove any mod */ | ||
440 | } | ||
441 | } | ||
435 | } | 442 | } |
436 | |||
437 | list = do_insert ? list-> m_prev : list-> m_next; | 443 | list = do_insert ? list-> m_prev : list-> m_next; |
438 | } | 444 | } |
439 | return (show_only) ? 0 : rc; | 445 | return (show_only) ? 0 : rc; |
@@ -665,5 +671,3 @@ extern int modprobe_main(int argc, char** argv) | |||
665 | 671 | ||
666 | return EXIT_SUCCESS; | 672 | return EXIT_SUCCESS; |
667 | } | 673 | } |
668 | |||
669 | |||