From: Michal Sekletar Date: Mon, 9 Sep 2024 16:48:48 +0000 (+0200) Subject: coredump: use FORK_WAIT X-Git-Tag: v257-rc1~99^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c287f0f7e9804a9276c738d977d60d542bd41bdd;p=thirdparty%2Fsystemd.git coredump: use FORK_WAIT --- diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index c15189b4ea6..0771e291c2b 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -1679,13 +1679,13 @@ static int gather_pid_mount_tree_fd(const Context *context) { "(sd-mount-tree)", /* except_fds= */ NULL, /* n_except_fds= */ 0, - FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL|FORK_LOG, + FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL|FORK_LOG|FORK_WAIT, /* pidns_fd= */ -EBADF, mntns_fd, /* netns_fd= */ -EBADF, /* userns_fd= */ -EBADF, root_fd, - &child); + NULL); if (r < 0) return r; if (r == 0) { @@ -1708,12 +1708,6 @@ static int gather_pid_mount_tree_fd(const Context *context) { pair[1] = safe_close(pair[1]); - r = wait_for_terminate_and_check("(sd-mount-tree-ns)", child, 0); - if (r < 0) - return log_error_errno(r, "Failed to wait for child: %m"); - if (r != EXIT_SUCCESS) - return log_error_errno(SYNTHETIC_ERRNO(ECHILD), "Child died abnormally."); - fd = receive_one_fd(pair[0], MSG_DONTWAIT); if (fd < 0) return log_error_errno(fd, "Failed to receive mount tree: %m");