Don't retry fork() in a loop.

If fork() fails, then report a fatal error.  Don't spin the cpu
retrying fork() until it succeeds.  It can fail when we reach a limit
on the number of processes.  Spinning on the cpu would slow down other
processes when we want them to exit.  This would get bad if we had a
parallel build with multiple ack processes spinning.
This commit is contained in:
George Koehler 2016-11-13 12:45:01 -05:00
parent e617f42503
commit fafc8a0b8a

View file

@ -80,7 +80,10 @@ static int run_exec(trf *phase, const char *prog) {
fflush(stdout) ; fflush(stdout) ;
fflush(stderr) ; fflush(stderr) ;
while ( (child=fork())== -1 ) ; child= fork() ;
if ( child== - 1) {
fatal("Cannot fork %s", prog) ;
}
if ( child ) { if ( child ) {
/* The parent */ /* The parent */
do { do {