aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2025-11-27 15:41:21 +0100
committerKarel Zak <kzak@redhat.com>2025-11-27 15:41:21 +0100
commitdbe4c16973d5d0f69ba3bf1bd8942a51de9a0933 (patch)
treeb1d34de5fab99139d0036f755b572261b007dfbd
parent72b3231a306c003e4a856df54240c32f8b8eb793 (diff)
downloadutil-linux-dbe4c16973d5d0f69ba3bf1bd8942a51de9a0933.tar.gz
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 <kzak@redhat.com>
-rw-r--r--sys-utils/lsns.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c
index 2e887e8025..2b73377775 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);