mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
core/namespace: merge if blocks
This commit is contained in:
@@ -2524,12 +2524,10 @@ int setup_namespace(const NamespaceParameters *p, char **error_path) {
|
||||
if (mount(NULL, "/", NULL, mount_propagation_flag | MS_REC, NULL) < 0)
|
||||
return log_debug_errno(errno, "Failed to remount '/' with desired mount flags: %m");
|
||||
|
||||
/* bind_mount_in_namespace() will MS_MOVE into that directory, and that's only
|
||||
* supported for non-shared mounts. This needs to happen after remounting / or it will fail. */
|
||||
if (setup_propagate) {
|
||||
if (mount(NULL, p->incoming_dir, NULL, MS_SLAVE, NULL) < 0)
|
||||
return log_debug_errno(errno, "Failed to remount %s with MS_SLAVE: %m", p->incoming_dir);
|
||||
}
|
||||
/* bind_mount_in_namespace() will MS_MOVE into that directory, and that's only supported for
|
||||
* non-shared mounts. This needs to happen after remounting / or it will fail. */
|
||||
if (setup_propagate && mount(NULL, p->incoming_dir, NULL, MS_SLAVE, NULL) < 0)
|
||||
return log_debug_errno(errno, "Failed to remount %s with MS_SLAVE: %m", p->incoming_dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user