From: Karel Zak Date: Thu, 27 Nov 2025 14:41:21 +0000 (+0100) Subject: lsns: fix const qualifier warnings for C23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbe4c16973d5d0f69ba3bf1bd8942a51de9a0933;p=thirdparty%2Futil-linux.git lsns: fix const qualifier warnings for C23 Fix const qualifier discarded warnings in read_persistent_namespaces() and is_path_included() functions. These warnings are reported by gcc 15 which defaults to the C23 standard. The strchr() and strstr() functions return pointers into const strings, so the receiving variables must be declared as const char *. Signed-off-by: Karel Zak --- diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index 2e887e802..2b7337777 100644 --- a/sys-utils/lsns.c +++ b/sys-utils/lsns.c @@ -1030,8 +1030,8 @@ static int read_persistent_namespaces(struct lsns *ls) struct libmnt_fs *fs = NULL; while (mnt_table_next_fs(ls->tab, itr, &fs) == 0) { - const char *root; - char *p, *end = NULL; + const char *root, *p; + char *end = NULL; ino_t ino; int fd; @@ -1126,7 +1126,7 @@ static int is_path_included(const char *path_set, const char *elt, { size_t elt_len; size_t path_set_len; - char *tmp; + const char *tmp; tmp = strstr(path_set, elt);