diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md index b6e5c2e156..9ebf2b3c64 100644 --- a/docs/ENVIRONMENT.md +++ b/docs/ENVIRONMENT.md @@ -141,7 +141,7 @@ All tools: * `$SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT=1` — if set, do not automatically soft-reboot instead of reboot when a new root file system has been loaded in - `/run/nextroot`. + `/run/nextroot/`. `systemd-nspawn`: diff --git a/man/systemctl.xml b/man/systemctl.xml index 217010ca1c..3a5ea94aca 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -1655,7 +1655,7 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err If a new kernel has been loaded via kexec --load, a kexec will be performed instead of a reboot, unless SYSTEMCTL_SKIP_AUTO_KEXEC=1 has been set. If a new root file system has - been setup on /run/nextroot, a soft-reboot will be + been set up on /run/nextroot/, a soft-reboot will be performed instead of a reboot, unless SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT=1 has been set. @@ -1711,7 +1711,7 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err systemd-soft-reboot.service8 for details. - If a new root file system has been setup on /run/nextroot, a + If a new root file system has been set up on /run/nextroot/, a soft-reboot will be performed when reboot is invoked, unless SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT=1 has been set. diff --git a/man/systemd-soft-reboot.service.xml b/man/systemd-soft-reboot.service.xml index 2419b86604..c232df41a1 100644 --- a/man/systemd-soft-reboot.service.xml +++ b/man/systemd-soft-reboot.service.xml @@ -165,7 +165,7 @@ ExecStart=sleep infinity executed directly. Instead, trigger system shutdown with a command such as systemctl soft-reboot. - Note that if a new root file system has been setup on /run/nextroot, a + Note that if a new root file system has been set up on /run/nextroot/, a soft-reboot will be performed when the reboot command is invoked. diff --git a/src/core/execute.c b/src/core/execute.c index 33adcd89f0..11513b267d 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -555,8 +555,8 @@ void exec_context_done(ExecContext *c) { c->syscall_archs = set_free(c->syscall_archs); c->address_families = set_free(c->address_families); - for (ExecDirectoryType t = 0; t < _EXEC_DIRECTORY_TYPE_MAX; t++) - exec_directory_done(&c->directories[t]); + FOREACH_ARRAY(d, c->directories, _EXEC_DIRECTORY_TYPE_MAX) + exec_directory_done(d); c->log_level_max = -1; @@ -2487,9 +2487,7 @@ void exec_params_serialized_done(ExecParameters *p) { p->cgroup_path = mfree(p->cgroup_path); if (p->prefix) { - for (ExecDirectoryType t = 0; t < _EXEC_DIRECTORY_TYPE_MAX; t++) - free(p->prefix[t]); - + free_many_charp(p->prefix, _EXEC_DIRECTORY_TYPE_MAX); p->prefix = mfree(p->prefix); } diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index e385f21777..b7ac03f5ae 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -1107,8 +1107,9 @@ static int mount_in_namespace( if (r > 0) return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to activate bind mount in target, not running in a mount namespace"); - if (pidref_verify(target) < 0) - return log_debug_errno(SYNTHETIC_ERRNO(ESRCH), "Failed to verify target process '" PID_FMT "': %m", target->pid); + r = pidref_verify(target); + if (r < 0) + return log_debug_errno(r, "Failed to verify target process '" PID_FMT "': %m", target->pid); r = chase(src, NULL, 0, &chased_src_path, &chased_src_fd); if (r < 0)