]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/systemctl/systemctl.c
process-spec: add another flag FORK_WAIT to safe_fork()
[thirdparty/systemd.git] / src / systemctl / systemctl.c
index fc921d1dd7dabb416fa75fa3e86c8d634d86b65b..741144b6cbb26715b70b2120b3dc940f74167349 100644 (file)
@@ -6987,12 +6987,11 @@ static int unit_file_create_copy(
 }
 
 static int run_editor(char **paths) {
-        pid_t pid;
         int r;
 
         assert(paths);
 
-        r = safe_fork("(editor)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG, &pid);
+        r = safe_fork("(editor)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG|FORK_WAIT, NULL);
         if (r < 0)
                 return r;
         if (r == 0) {
@@ -7057,10 +7056,6 @@ static int run_editor(char **paths) {
                 _exit(EXIT_FAILURE);
         }
 
-        r = wait_for_terminate_and_check("editor", pid, WAIT_LOG);
-        if (r < 0)
-                return r;
-
         return 0;
 }