X-Git-Url: https://ruderich.org/simon/gitweb/?p=ptyas%2Fptyas.git;a=blobdiff_plain;f=ptyas.c;h=9fc7997269a23b756f8a173f399f8bbad771df26;hp=4b7b208856e88f53a43abc833ea4dde6a7c5bcdb;hb=dad601b98c99c7597d7d6e1df85028d884051a90;hpb=558cfda92d46baf905c1fad7814b1c92d1ce752f diff --git a/ptyas.c b/ptyas.c index 4b7b208..9fc7997 100644 --- a/ptyas.c +++ b/ptyas.c @@ -270,10 +270,12 @@ static void proxy_input_between_ttys(int pty_master, int ctty, volatile pid_t *p static volatile pid_t pid_to_wait_for; static int pid_to_wait_for_status; -static void sigchld_handler() { +static void sigchld_handler(int signal) { int status; pid_t pid; + (void)signal; + while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { if (pid == pid_to_wait_for) { /* Mark that our child has died and we should exit as well. */