tree-wide: reopen log after fork when needed
This follows up on 0b1f3c768c, adding more places
where we should reopen the log after forking with FORK_CLOSE_ALL_FDS.
When immediately calling exec in the child, prefer to explicitly reopen the log
after exec fails. In other cases, just use FORK_REOPEN_LOG.
This commit is contained in:
@@ -1287,6 +1287,7 @@ static int run_fsck(const char *node, const char *fstype) {
|
||||
if (r == 0) {
|
||||
/* Child */
|
||||
execl("/sbin/fsck", "/sbin/fsck", "-aT", node, NULL);
|
||||
log_open();
|
||||
log_debug_errno(errno, "Failed to execl() fsck: %m");
|
||||
_exit(FSCK_OPERATIONAL_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user