summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2006-02-08 17:29:07 +0000
committerBoris Kolpackov <boris@kolpackov.net>2006-02-08 17:29:07 +0000
commitd0c4e92f1145110793ffb04596019a864c88d2fc (patch)
tree97e0f900c14e63fc3c74a7de9d9aa144fc538adf
parentce9c63b32b9e31b3902de2987c81732540b89a1e (diff)
downloadgunmake-d0c4e92f1145110793ffb04596019a864c88d2fc.tar.gz
Fixed Savannah bug #15641.
-rw-r--r--ChangeLog7
-rw-r--r--job.c8
-rw-r--r--job.h1
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/scripts/features/parallelism18
5 files changed, 36 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c1e05de..fbe12be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-08 Boris Kolpackov <boris@kolpackov.net>
+
+ * job.h (struct child): Add dontcare bitfield.
+ * job.c (new_job): Cache dontcare flag.
+ * job.c (reap_children): Use cached dontcare flag instead of the
+ one in struct file. Fixes Savannah bug #15641.
+
2006-02-06 Paul D. Smith <psmith@gnu.org>
* vpath.c (selective_vpath_search): If the file we find has a
diff --git a/job.c b/job.c
index 1c75420..fb07141 100644
--- a/job.c
+++ b/job.c
@@ -383,7 +383,7 @@ child_error (char *target_name, int exit_code, int exit_sig, int coredump,
{
if (ignored && silent_flag)
return;
-
+
#ifdef VMS
if (!(exit_code & 1))
error (NILF,
@@ -718,7 +718,7 @@ reap_children (int block, int err)
if (c->good_stdin)
good_stdin_used = 0;
- dontcare = c->file->dontcare;
+ dontcare = c->dontcare;
if (child_failed && !c->noerror && !ignore_errors_flag)
{
@@ -1612,6 +1612,10 @@ new_job (struct file *file)
c->command_lines = lines;
c->sh_batch_file = NULL;
+ /* Cache dontcare flag because file->dontcare can be changed once we
+ return. Check dontcare inheritance mechanism for details. */
+ c->dontcare = file->dontcare;
+
/* Fetch the first command line to be run. */
job_next_command (c);
diff --git a/job.h b/job.h
index 5a0ae75..c0e42dd 100644
--- a/job.h
+++ b/job.h
@@ -63,6 +63,7 @@ struct child
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
+ unsigned int dontcare:1; /* Saved dontcare flag. */
};
extern struct child *children;
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 8a3b988..3e05ab8 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2006-02-08 Boris Kolpackov <boris@kolpackov.net>
+
+ * scripts/features/parallelism: Add a test for bug #15641.
+
2006-02-06 Paul D. Smith <psmith@gnu.org>
* scripts/options/dash-W: Add a test for bug #15341.
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index 6bde30f..60ae55b 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -108,4 +108,22 @@ Ok done',
512);
+# Test for Savannah bug #15641.
+#
+run_make_test('
+.PHONY: all
+all:; @:
+
+-include foo.d
+
+foo.d: comp
+ @echo building $@
+
+comp: mod_a.o mod_b.o; @:
+
+mod_a.o mod_b.o:
+ @exit 1
+', '-j2', '');
+
+
1;