Previously, rmmod would display an error message when the module
WAS removed, and would display no error when the module WAS NOT
removed.

Signed-off-by: Dan Fandrich <[email protected]>
---
 modutils/modprobe-small.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 05f2c34..5f6bd4e 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -522,7 +522,7 @@ static void process_module(char *name, const char 
*cmdline_options)
 
        dbg1_error_msg("already_loaded:%d is_rmmod:%d", already_loaded(name), 
is_rmmod);
        if (already_loaded(name) != is_rmmod) {
-               dbg1_error_msg("nothing to do for '%s'", name);
+               bb_perror_msg("nothing to do for '%s'", name);
                return;
        }
 
@@ -594,7 +594,8 @@ static void process_module(char *name, const char 
*cmdline_options)
 
        if (!info) {
                /* both dirscan and find_alias found nothing */
-               if (applet_name[0] != 'd') /* it wasn't depmod */
+               if ((applet_name[0] != 'd') && !is_rmmod)
+                       /* it wasn't depmod or rmmod */
                        bb_error_msg("module '%s' not found", name);
 //TODO: _and_die()?
                goto ret;
-- 
1.5.3.2

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to