]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools: fix kmod-modprobe -R trying to insert module
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 16 Dec 2011 04:58:48 +0000 (02:58 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 16 Dec 2011 04:58:48 +0000 (02:58 -0200)
TODO
tools/kmod-modprobe.c

diff --git a/TODO b/TODO
index d574f8c7b38604305bce8791940e14d42130dd77..5cead3200207ffdb91cdda53b601007e6aa7742b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -35,7 +35,6 @@ Features:
 Known Bugs:
 ===========
 
-* modprobe -R should not try to load module
 
 Notes for future development:
 =============================
index a036a44d3c4245f85e84359f77bd74a85ca1f42d..5b9ed7cb53839e1a2fb4d432d3e3d7f3a7b34581 100644 (file)
@@ -38,7 +38,7 @@ static int use_syslog = 0;
 static int verbose = DEFAULT_VERBOSE;
 static int dry_run = 0;
 static int ignore_loaded = 0;
-static int show_resolved_aliases = 0;
+static int lookup_only = 0;
 static int first_time = 0;
 static int ignore_commands = 0;
 static int use_blacklist = 0;
@@ -725,7 +725,10 @@ static int insmod_alias(struct kmod_ctx *ctx, const char *alias, const char *ext
 
        kmod_list_foreach(l, list) {
                struct kmod_module *mod = kmod_module_get_module(l);
-               err = insmod_do(mod, extra_options);
+               if (lookup_only)
+                       printf("%s\n", kmod_module_get_name(mod));
+               else
+                       err = insmod_do(mod, extra_options);
                kmod_module_unref(mod);
                if (err < 0)
                        break;
@@ -986,7 +989,7 @@ int main(int argc, char **orig_argv)
                        remove_dependencies = 1;
                        break;
                case 'R':
-                       show_resolved_aliases = 1;
+                       lookup_only = 1;
                        break;
                case 3:
                        first_time = 1;