]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/depmod: don't use %m on mkdir_p() 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/depmod.c

index 9b0a9cd9ea8420ee48b4707904f2b6398214d838..9ec47dbcbf759bfbe108ea6bfbc3ffbdc6c6bcab 100644 (file)
@@ -2580,7 +2580,7 @@ static int depmod_output(struct depmod *depmod, FILE *out)
        else {
                err = mkdir_p(dname, strlen(dname), 0755);
                if (err < 0) {
-                       CRIT("could not create directory %s: %m\n", dname);
+                       CRIT("could not create directory %s: %s\n", dname, strerror(-err));
                        return err;
                }
                dfd = open(dname, O_RDONLY);