]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/depmod: don't use %m on kmod_new() failure
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 4 Jun 2025 16:16:25 +0000 (17:16 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 11 Jun 2025 13:03:26 +0000 (08:03 -0500)
The KMOD API returns NULL on error and getting the exact means why it
failed is undefined. In practise the errno is set in _some_ of the error
paths, but not all.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/368
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/depmod.c

index 9ec47dbcbf759bfbe108ea6bfbc3ffbdc6c6bcab..355483ad89d255fed35e8f3934f341b79c18eedf 100644 (file)
@@ -3030,7 +3030,7 @@ static int do_depmod(int argc, char *argv[])
 
        ctx = kmod_new(cfg.dirname, &null_kmod_config);
        if (ctx == NULL) {
-               CRIT("kmod_new(\"%s\", {NULL}) failed: %m\n", cfg.dirname);
+               CRIT("kmod_new(\"%s\", {NULL}) failed\n", cfg.dirname);
                goto cmdline_failed;
        }