summaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorDenys Vlasenko2009-05-26 12:48:34 +0200
committerDenys Vlasenko2009-05-26 12:48:34 +0200
commit140def848c1a5997383a2954590663b55155e169 (patch)
treeffe5d584b983abe942e5fae0e0cbee94eef91d8f /modutils
parent8d7be232a39c6fb85b6870d1a705ceca48bed869 (diff)
downloadbusybox-140def848c1a5997383a2954590663b55155e169.zip
busybox-140def848c1a5997383a2954590663b55155e169.tar.gz
modprobe: fix modprobe -r. closes bug 315
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index d57dbdf..54cd84c 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -114,7 +114,9 @@ static void add_probe(const char *name)
struct module_entry *m;
m = get_or_add_modentry(name);
- if (m->flags & MODULE_FLAG_LOADED) {
+ if (!(option_mask32 & MODPROBE_OPT_REMOVE)
+ && (m->flags & MODULE_FLAG_LOADED)
+ ) {
DBG("skipping %s, it is already loaded", name);
return;
}
@@ -350,7 +352,7 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
config_close(parser);
}
- if (opt & MODPROBE_OPT_INSERT_ALL) {
+ if (opt & (MODPROBE_OPT_INSERT_ALL | MODPROBE_OPT_REMOVE)) {
/* Each argument is a module name */
do {
DBG("adding module %s", *argv);