From: Lennart Poettering Date: Thu, 6 Aug 2020 10:49:42 +0000 (+0200) Subject: namespace: assert() first, use second X-Git-Tag: v247-rc1~378^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df6b900a1bc52fa4bdc5e26eb00a953c576fbbc0;p=thirdparty%2Fsystemd.git namespace: assert() first, use second --- diff --git a/src/core/namespace.c b/src/core/namespace.c index 4e33fcac3c8..2e13b10d9ce 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -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; }