From: Ralph Corderoy Date: Fri, 8 Sep 2017 13:30:31 +0000 (+0100) Subject: mhbuildsbr.c: Attempt fork(2) multiple times, as intended. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/9a603b2b55d3d25e6201a56d5d2431fce17970d5?hp=1e5cdbdd102555b43fc3ffa9a45ba9e7a833c190 mhbuildsbr.c: Attempt fork(2) multiple times, as intended. The loop attempting fork() intends to try five times but the comparison operator was wrong so would only try once. Bug present since pre-git. --- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 7c0e7941..118b82b7 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -1321,7 +1321,7 @@ raw: if ((out = fopen (ce->ce_file, "w")) == NULL) adios (ce->ce_file, "unable to open for writing"); - for (i = 0; (child_id = fork()) == NOTOK && i > 5; i++) + for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: