aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2009-09-30 17:22:11 +0100
committerAlan Jenkins <alan-jenkins@tuffmail.co.uk>2010-02-25 15:29:23 +0000
commit6c31b6a061020a0b6af0aba28674a2e37516e6b3 (patch)
treedd21a5eb2fd72fff12a38c820f06d431a86e2c0c
parentd64f843b5aeec65a725b7eed267b6a32cad190a2 (diff)
downloadmodule-init-tools-6c31b6a061020a0b6af0aba28674a2e37516e6b3.tar.gz
modprobe: clean up mit_ignore_loaded flag in rmmod()
handle_module() clears mit_ignore_loaded before calling rmmod(). So we didn't really want to set it in the first place! Also, rmmod() uses the flag to mean something which differs both from the name itself, and the way it is used in insmod(). Replace the mit_ignore_loaded in rmmod() with a new flag mit_quiet_inuse (it means not to complain if the module cannot be removed because it is in use). Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
-rw-r--r--modprobe.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/modprobe.c b/modprobe.c
index 6743759..6cf51bd 100644
--- a/modprobe.c
+++ b/modprobe.c
@@ -68,9 +68,10 @@ typedef enum
mit_use_blacklist = 8,
mit_ignore_commands = 16,
mit_ignore_loaded = 32,
- mit_strip_vermagic = 64,
- mit_strip_modversion = 128,
- mit_resolve_alias = 256
+ mit_quiet_inuse = 64,
+ mit_strip_vermagic = 128,
+ mit_strip_modversion = 256,
+ mit_resolve_alias = 512
} modprobe_flags_t;
@@ -1335,7 +1336,7 @@ static void rmmod(struct list_head *list,
}
if (usecount != 0) {
- if (!(flags & mit_ignore_loaded))
+ if (!(flags & mit_quiet_inuse))
error("Module %s is in use.\n", name);
goto remove_rest;
}
@@ -1358,7 +1359,7 @@ static void rmmod(struct list_head *list,
if (!list_empty(list)) {
flags &= ~mit_first_time;
flags &= ~mit_ignore_commands;
- flags |= mit_ignore_loaded;
+ flags |= mit_quiet_inuse;
rmmod(list, NULL, commands, "", warn, flags);
}
@@ -1397,10 +1398,9 @@ static int handle_module(const char *modname,
return 1;
}
- if (flags & mit_remove) {
- flags &= ~mit_ignore_loaded;
+ if (flags & mit_remove)
rmmod(todo_list, newname, commands, cmdline_opts, error, flags);
- } else
+ else
insmod(todo_list, NOFAIL(strdup(options)), newname,
modoptions, commands, cmdline_opts, error, flags);