]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
namespace: return correct error code
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Feb 2021 12:36:32 +0000 (13:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Feb 2021 12:36:32 +0000 (13:36 +0100)
src/core/namespace.c

index ed07db5c731d9ab3851007d00dfeeac41ec786ab..9a0375fddd25bd0a142ee21d6f7949604d8d0e99 100644 (file)
@@ -1554,9 +1554,12 @@ static int apply_mounts(
          * /proc. For example, this is the case with the option: 'InaccessiblePaths=/proc'. */
         proc_self_mountinfo = fopen("/proc/self/mountinfo", "re");
         if (!proc_self_mountinfo) {
+                r = -errno;
+
                 if (error_path)
                         *error_path = strdup("/proc/self/mountinfo");
-                return log_debug_errno(errno, "Failed to open /proc/self/mountinfo: %m");
+
+                return log_debug_errno(r, "Failed to open /proc/self/mountinfo: %m");
         }
 
         /* First round, establish all mounts we need */