ptty: explicit wait for child - scroll - scrollbackbuffer program for st
 (HTM) git clone git://git.suckless.org/scroll
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit d10c029b182fef1af4c6ec2713f9a8a3a5245edb
 (DIR) parent ea938bbb0415e745bc969e4bf4123a41723e740f
 (HTM) Author: Jan Klemkow <j.klemkow@wemelug.de>
       Date:   Thu, 16 Apr 2020 23:19:21 +0200
       
       ptty: explicit wait for child
       
       Diffstat:
         M ptty.c                              |       6 ++----
       
       1 file changed, 2 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/ptty.c b/ptty.c
       @@ -138,11 +138,9 @@ main(int argc, char *argv[])
                                break;
                }
        
       -        pid_t pid;
                int status;
       -        while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
       -                if (pid != child)
       -                        continue;
       +        if (waitpid(child, &status, 0) != child)
       +                die("waitpid:");
        
                return WEXITSTATUS(status);
        }