From db06c162e8c077e6c6844e14bdf70c5ef8a40a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 11 Jul 2020 21:12:08 +0200 Subject: [PATCH 1/2] shared: fix error handling in make_inaccessible_nodes _label wrappers return -errno on failure instead of returning -1 and setting global errno. Fixes: 8d9cbd809db492df9d94c0c664bd0d2e53416531 Follow up: #16426 --- src/shared/dev-setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c index 7641909c1b..6e57e2a99d 100644 --- a/src/shared/dev-setup.c +++ b/src/shared/dev-setup.c @@ -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; } From f2df56bfea5a61e2d19077a67246d90244a46c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 11 Jul 2020 21:12:55 +0200 Subject: [PATCH 2/2] namespace: unify logging in mount_tmpfs Fixes: abad72be4df9d5a13ceecd5b4d073adb370882b7 Follow up: #16426 --- src/core/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/namespace.c b/src/core/namespace.c index ebdbb7545b..20f8beab1a 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -876,7 +876,7 @@ static int mount_tmpfs(const MountEntry *m) { r = label_fix_container(entry_path, source_path, 0); if (r < 0) - return log_error_errno(r, "Failed to fix label of '%s' as '%s': %m", entry_path, source_path); + return log_debug_errno(r, "Failed to fix label of '%s' as '%s': %m", entry_path, source_path); return 1; }