]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (utils) avoid dead store
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 24 Dec 2023 12:08:15 +0000 (13:08 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 31 Dec 2023 12:06:02 +0000 (13:06 +0100)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libmount/src/utils.c

index 056c5d4fb0a52e4f74cbfdd1b4c6e31c56005f1c..f301f3f5677a9f2525129c98ba3537eed5186980 100644 (file)
@@ -1134,7 +1134,7 @@ char *mnt_get_kernel_cmdline_option(const char *name)
        int val = 0;
        char *p, *res = NULL, *mem = NULL;
        char buf[BUFSIZ];       /* see kernel include/asm-generic/setup.h: COMMAND_LINE_SIZE */
-       const char *path = _PATH_PROC_CMDLINE;
+       const char *path;
 
        if (!name || !name[0])
                return NULL;
@@ -1143,6 +1143,8 @@ char *mnt_get_kernel_cmdline_option(const char *name)
        path = getenv("LIBMOUNT_KERNEL_CMDLINE");
        if (!path)
                path = _PATH_PROC_CMDLINE;
+#else
+       path = _PATH_PROC_CMDLINE;
 #endif
        f = fopen(path, "r" UL_CLOEXECSTR);
        if (!f)