namespace: assert() first, use second

This commit is contained in:
Lennart Poettering 2020-08-06 12:49:42 +02:00
parent 52b3d6523f
commit df6b900a1b
1 changed files with 6 additions and 4 deletions

View 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;
}