]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: use FORK_WAIT
authorMichal Sekletar <msekleta@redhat.com>
Mon, 9 Sep 2024 16:48:48 +0000 (18:48 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 30 Oct 2024 12:38:26 +0000 (12:38 +0000)
src/coredump/coredump.c

index c15189b4ea6bf37001298a51e67f43e9cc9a7445..0771e291c2b50a5c52036291779d06941f9bdf6a 100644 (file)
@@ -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");