From 6ff68d3d5a1c5235f2738e1f9ea327c4ed56ef82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 20 Apr 2020 11:51:56 +0200 Subject: [PATCH] Explicitly wait for intermediate process --- abduco.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/abduco.c b/abduco.c index 792e5f5..afaf13d 100644 --- a/abduco.c +++ b/abduco.c @@ -501,8 +501,7 @@ static bool create_session(const char *name, char * const argv[]) { return false; default: /* parent = client process */ close(client_pipe[1]); - int status; - wait(&status); /* wait for first fork */ + while (waitpid(pid, NULL, 0) == -1 && errno == EINTR); ssize_t len = read_all(client_pipe[0], errormsg, sizeof(errormsg)); if (len > 0) { write_all(STDERR_FILENO, errormsg, len);