]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
util: Use const variable type in mkdir_parents
authorRudi Heitbaum <rudi@heitbaum.com>
Sun, 8 Feb 2026 14:49:49 +0000 (01:49 +1100)
committerLucas De Marchi <demarchi@kernel.org>
Mon, 9 Feb 2026 15:57:47 +0000 (09:57 -0600)
For ISO C23, the function strchr that return pointers into their input
arrays now have definitions as macros that return a pointer to a
const-qualified type when the in put argument is a pointer to a
const-qualified type.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/pull/422
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
shared/util.c

index b4ce172a5c82b8e98ef02d054ca8f7eb502dbd8e..4e2736ddb5a4511ed1577a73154a3a373a365e8b 100644 (file)
@@ -467,7 +467,7 @@ int mkdir_p(const char *path, int len, mode_t mode)
 
 int mkdir_parents(const char *path, mode_t mode)
 {
-       char *end = strrchr(path, '/');
+       const char *end = strrchr(path, '/');
 
        /* no parent directories */
        if (end == NULL)