From 3f459ccb71ac90a69171f23676c56a457d651cc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 24 Dec 2023 13:08:15 +0100 Subject: [PATCH] libmount: (utils) avoid dead store MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- libmount/src/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.47.3