]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
rmmod: remove --wait option
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 20 Sep 2013 06:40:58 +0000 (01:40 -0500)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 20 Sep 2013 06:42:04 +0000 (01:42 -0500)
Let libkmod enforce KMOD_REMOVE_NOWAIT.

tools/rmmod.c

index bf5a40888568814f30143e78fd84110981bae7e7..fd0fac54dcae955e87a585e039e167c4d924e068 100644 (file)
@@ -104,7 +104,7 @@ static int do_rmmod(int argc, char *argv[])
 {
        struct kmod_ctx *ctx;
        const char *null_config = NULL;
-       int flags = KMOD_REMOVE_NOWAIT;
+       int flags = 0;
        int i, err, r = 0;
 
        for (;;) {
@@ -122,11 +122,6 @@ static int do_rmmod(int argc, char *argv[])
                case 'v':
                        verbose++;
                        break;
-               case 'w':
-                       ERR("'Wait' behavior is targeted for removal from kernel.\nWe will now sleep for 10s, and then continue.\n");
-                       sleep(10);
-                       flags &= ~KMOD_REMOVE_NOWAIT;
-                       break;
                case 'h':
                        help();
                        return EXIT_SUCCESS;
@@ -173,11 +168,10 @@ static int do_rmmod(int argc, char *argv[])
                        break;
                }
 
-               if (!(flags & KMOD_REMOVE_FORCE) && (flags & KMOD_REMOVE_NOWAIT))
-                       if (check_module_inuse(mod) < 0) {
-                               r++;
-                               goto next;
-                       }
+               if (!(flags & KMOD_REMOVE_FORCE) && check_module_inuse(mod) < 0) {
+                       r++;
+                       goto next;
+               }
 
                err = kmod_module_remove_module(mod, flags);
                if (err < 0) {