From: Thomas Weißschuh Date: Sun, 24 Dec 2023 12:08:15 +0000 (+0100) Subject: libmount: (utils) avoid dead store X-Git-Tag: v2.40-rc1~84^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f459ccb71ac90a69171f23676c56a457d651cc8;p=thirdparty%2Futil-linux.git libmount: (utils) avoid dead store Signed-off-by: Thomas Weißschuh --- diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 056c5d4fb0..f301f3f567 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -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)