make-3.80-parallel-build-failure.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. http://lists.gnu.org/archive/html/bug-make/2005-07/msg00050.html
  2. http://lists.gnu.org/archive/html/bug-make/2005-08/msg00019.html
  3. http://bugs.gentoo.org/107613
  4. 2005-08-07 Paul D. Smith <psmith@gnu.org>
  5. Fix a bug reported by Michael Matz <matz@suse.de>: patch included.
  6. If make is running in parallel without -k and two jobs die in a
  7. row, but not too close to each other, then make will quit without
  8. waiting for the rest of the jobs to die.
  9. * main.c (die): Don't reset err before calling reap_children() the
  10. second time: we still want it to be in the error condition.
  11. * job.c (reap_children): Use a static variable, rather than err,
  12. to control whether or not the error message should be printed.
  13. Index: job.c
  14. ===================================================================
  15. RCS file: /cvsroot/make/make/job.c,v
  16. retrieving revision 1.166
  17. retrieving revision 1.167
  18. diff -u -p -r1.166 -r1.167
  19. --- job.c 26 Jun 2005 03:31:30 -0000 1.166
  20. +++ job.c 8 Aug 2005 05:08:00 -0000 1.167
  21. @@ -475,9 +479,14 @@ reap_children (int block, int err)
  22. if (err && block)
  23. {
  24. - /* We might block for a while, so let the user know why. */
  25. + static int printed = 0;
  26. +
  27. + /* We might block for a while, so let the user know why.
  28. + Only print this message once no matter how many jobs are left. */
  29. fflush (stdout);
  30. - error (NILF, _("*** Waiting for unfinished jobs...."));
  31. + if (!printed)
  32. + error (NILF, _("*** Waiting for unfinished jobs...."));
  33. + printed = 1;
  34. }
  35. /* We have one less dead child to reap. As noted in
  36. Index: main.c
  37. ===================================================================
  38. RCS file: /cvsroot/make/make/main.c,v
  39. retrieving revision 1.210
  40. retrieving revision 1.211
  41. diff -u -p -r1.210 -r1.211
  42. --- main.c 12 Jul 2005 04:35:13 -0000 1.210
  43. +++ main.c 8 Aug 2005 05:08:00 -0000 1.211
  44. @@ -2990,7 +2996,8 @@ die (int status)
  45. print_version ();
  46. /* Wait for children to die. */
  47. - for (err = (status != 0); job_slots_used > 0; err = 0)
  48. + err = (status != 0);
  49. + while (job_slots_used > 0)
  50. reap_children (1, err);
  51. /* Let the remote job module clean up its state. */