]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: fix error handling in make_inaccessible_nodes
authorChristian Göttsche <cgzones@googlemail.com>
Sat, 11 Jul 2020 19:12:08 +0000 (21:12 +0200)
committerChristian Göttsche <cgzones@googlemail.com>
Sat, 11 Jul 2020 19:25:39 +0000 (21:25 +0200)
_label wrappers return -errno on failure instead of returning -1 and
setting global errno.

Fixes: 8d9cbd809db492df9d94c0c664bd0d2e53416531
Follow up: #16426

src/shared/dev-setup.c

index 7641909c1b2c9d29b337e0633dde19a215d9cc03..6e57e2a99d3a79fd3f22d39239bfc4c93431d0ab 100644 (file)
@@ -107,8 +107,8 @@ int make_inaccessible_nodes(
                 else
                         r = mknod_label(path, table[i].mode, makedev(0, 0));
                 if (r < 0) {
-                        if (errno != EEXIST)
-                                log_debug_errno(errno, "Failed to create '%s', ignoring: %m", path);
+                        if (r != -EEXIST)
+                                log_debug_errno(r, "Failed to create '%s', ignoring: %m", path);
                         continue;
                 }