Skip to content

Commit df6b900

Browse files
committed
namespace: assert() first, use second
1 parent 52b3d65 commit df6b900

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/core/namespace.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,12 +884,14 @@ static int mount_procfs(const MountEntry *m) {
884884
}
885885

886886
static int mount_tmpfs(const MountEntry *m) {
887+
const char *entry_path, *inner_path;
887888
int r;
888-
const char *entry_path = mount_entry_path(m);
889-
const char *source_path = m->path_const;
890889

891890
assert(m);
892891

892+
entry_path = mount_entry_path(m);
893+
inner_path = m->path_const;
894+
893895
/* First, get rid of everything that is below if there is anything. Then, overmount with our new tmpfs */
894896

895897
(void) mkdir_p_label(entry_path, 0755);
@@ -898,9 +900,9 @@ static int mount_tmpfs(const MountEntry *m) {
898900
if (mount("tmpfs", entry_path, "tmpfs", m->flags, mount_entry_options(m)) < 0)
899901
return log_debug_errno(errno, "Failed to mount %s: %m", entry_path);
900902

901-
r = label_fix_container(entry_path, source_path, 0);
903+
r = label_fix_container(entry_path, inner_path, 0);
902904
if (r < 0)
903-
return log_debug_errno(r, "Failed to fix label of '%s' as '%s': %m", entry_path, source_path);
905+
return log_debug_errno(r, "Failed to fix label of '%s' as '%s': %m", entry_path, inner_path);
904906

905907
return 1;
906908
}

0 commit comments

Comments
 (0)