]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: use the just returned errno in the log message
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 15 May 2023 17:06:14 +0000 (19:06 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 16 May 2023 09:27:10 +0000 (11:27 +0200)
Use the returned errno even though we are going to ignore it, otherwise
the log message is just confusing:

config.json:119:13: Failed to resolve device node 4:2, ignoring: Success

src/nspawn/nspawn-oci.c

index fc9b763a96bb7043126a39ed682c3a3c16c58db7..2b1fae0df4b2a76cdc20a87e22d36e103c1197c1 100644 (file)
@@ -874,7 +874,7 @@ static int oci_devices(const char *name, JsonVariant *v, JsonDispatchFlags flags
                         /* Suppress a couple of implicit device nodes */
                         r = devname_from_devnum(node->mode, makedev(node->major, node->minor), &path);
                         if (r < 0)
-                                json_log(e, flags|JSON_DEBUG, 0, "Failed to resolve device node %u:%u, ignoring: %m", node->major, node->minor);
+                                json_log(e, flags|JSON_DEBUG, r, "Failed to resolve device node %u:%u, ignoring: %m", node->major, node->minor);
                         else {
                                 if (PATH_IN_SET(path,
                                                 "/dev/null",