summaryrefslogtreecommitdiff
blob: 717e0f3556cea6d1cc9e84a7d251eb971945763f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
http://lists.gnu.org/archive/html/bug-make/2005-07/msg00050.html
http://lists.gnu.org/archive/html/bug-make/2005-08/msg00019.html
http://bugs.gentoo.org/107613

2005-08-07  Paul D. Smith  <psmith@gnu.org>

    Fix a bug reported by Michael Matz <matz@suse.de>: patch included.
    If make is running in parallel without -k and two jobs die in a
    row, but not too close to each other, then make will quit without
    waiting for the rest of the jobs to die.

    * main.c (die): Don't reset err before calling reap_children() the
    second time: we still want it to be in the error condition.
    * job.c (reap_children): Use a static variable, rather than err,
    to control whether or not the error message should be printed.

Index: job.c
===================================================================
RCS file: /cvsroot/make/make/job.c,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -p -r1.166 -r1.167
--- job.c	26 Jun 2005 03:31:30 -0000	1.166
+++ job.c	8 Aug 2005 05:08:00 -0000	1.167
@@ -475,9 +479,14 @@ reap_children (int block, int err)
 
       if (err && block)
 	{
-	  /* We might block for a while, so let the user know why.  */
+          static int printed = 0;
+
+	  /* We might block for a while, so let the user know why.
+             Only print this message once no matter how many jobs are left.  */
 	  fflush (stdout);
-	  error (NILF, _("*** Waiting for unfinished jobs...."));
+          if (!printed)
+            error (NILF, _("*** Waiting for unfinished jobs...."));
+          printed = 1;
 	}
 
       /* We have one less dead child to reap.  As noted in
Index: main.c
===================================================================
RCS file: /cvsroot/make/make/main.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -p -r1.210 -r1.211
--- main.c	12 Jul 2005 04:35:13 -0000	1.210
+++ main.c	8 Aug 2005 05:08:00 -0000	1.211
@@ -2990,7 +2996,8 @@ die (int status)
 	print_version ();
 
       /* Wait for children to die.  */
-      for (err = (status != 0); job_slots_used > 0; err = 0)
+      err = (status != 0);
+      while (job_slots_used > 0)
 	reap_children (1, err);
 
       /* Let the remote job module clean up its state.  */