]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
namespace: assert() first, use second
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Aug 2020 10:49:42 +0000 (12:49 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Aug 2020 18:10:58 +0000 (20:10 +0200)
src/core/namespace.c

index 4e33fcac3c81e226aa9c0d7c90e43e09c16c102c..2e13b10d9cefaf4306d9ba2785709a6558132b21 100644 (file)
@@ -884,12 +884,14 @@ static int mount_procfs(const MountEntry *m) {
 }
 
 static int mount_tmpfs(const MountEntry *m) {
+        const char *entry_path, *inner_path;
         int r;
-        const char *entry_path = mount_entry_path(m);
-        const char *source_path = m->path_const;
 
         assert(m);
 
+        entry_path = mount_entry_path(m);
+        inner_path = m->path_const;
+
         /* First, get rid of everything that is below if there is anything. Then, overmount with our new tmpfs */
 
         (void) mkdir_p_label(entry_path, 0755);
@@ -898,9 +900,9 @@ static int mount_tmpfs(const MountEntry *m) {
         if (mount("tmpfs", entry_path, "tmpfs", m->flags, mount_entry_options(m)) < 0)
                 return log_debug_errno(errno, "Failed to mount %s: %m", entry_path);
 
-        r = label_fix_container(entry_path, source_path, 0);
+        r = label_fix_container(entry_path, inner_path, 0);
         if (r < 0)
-                return log_debug_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, inner_path);
 
         return 1;
 }