]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/rmmod: make opt variables non-global
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 18 Sep 2024 15:49:08 +0000 (16:49 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 21 Sep 2024 15:53:12 +0000 (10:53 -0500)
They're used locally within one function so declare them there.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/138
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/rmmod.c

index 6b924ab1a096fd39e33a8eedc01fca99f5077d69..b56416c28287f763486c001c3cbe75e88ca239f9 100644 (file)
 
 #include "kmod.h"
 
-#define DEFAULT_VERBOSE LOG_ERR
-static int verbose = DEFAULT_VERBOSE;
-static int use_syslog;
-
 static const char cmdopts_s[] = "fsvVh";
 static const struct option cmdopts[] = {
        // clang-format off
@@ -97,6 +93,8 @@ static int do_rmmod(int argc, char *argv[])
 {
        struct kmod_ctx *ctx;
        const char *null_config = NULL;
+       int verbose = LOG_ERR;
+       int use_syslog;
        int flags = 0;
        int i, err, r = 0;