]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/static-nodes: don't use %m on mkdir_parents() 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 function returns the error code itself, so we should be using
strerror(-err) instead.

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/static-nodes.c

index c2ba1f808b4047036a05a3bd3b6729bb41a5643d..49f55549703df98355b2f147f2020f538d81725b 100644 (file)
@@ -233,8 +233,8 @@ static int do_static_nodes(int argc, char *argv[])
                r = mkdir_parents(output, 0755);
                if (r < 0) {
                        fprintf(stderr,
-                               "Error: could not create parent directory for %s - %m.\n",
-                               output);
+                               "Error: could not create parent directory for %s - %s.\n",
+                               output, strerror(-r));
                        ret = EXIT_FAILURE;
                        goto finish;
                }