summaryrefslogtreecommitdiff
path: root/tests/run_make_tests.pl
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2018-08-04 12:18:39 -0400
committerPaul Smith <psmith@gnu.org>2018-08-04 12:18:39 -0400
commit3112c8799358cb5d051e0b63d0e916357169942c (patch)
tree902ed1b82a9e4ab431104c96c2cdb07f2c6cfed5 /tests/run_make_tests.pl
parent8bde7db16fa4e51239ece8a83420c580938bda24 (diff)
downloadmake-git-3112c8799358cb5d051e0b63d0e916357169942c.tar.gz
Queue failed fork() (etc.) to be handled like any other failed job.
If we failed to fork() we were essentially exiting make immediately without respect to ignore flags, etc. On one hand that makes sense because if you can't fork you're in real trouble, but it doesn't work so well on systems where we don't fork at all. Instead, treat a fork error like any other error by delaying the handling until the next call to reap_children(). Any child with a PID of -1 is considered to have died before starting so check these first without waiting for them. * src/commands.c (fatal_error_signal): Don't kill children that never started. * src/function.c (func_shell_base): Handle cleanup properly if the child doesn't start. * src/job.c (reap_children): Check for children that died before starting and handle them without waiting for the PID. (start_job_command): Free memory when the child doesn't start. (start_waiting_job): Don't manage children who never started. (child_execute_job): If the fork fails return PID -1. * src/vmsjobs.c: Check for children that never started. * tests/run_make_tests.pl: Parse config.status to get all options.
Diffstat (limited to 'tests/run_make_tests.pl')
-rw-r--r--tests/run_make_tests.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 2e063072..500524e3 100644
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -71,9 +71,16 @@ use FindBin;
use lib "$FindBin::Bin";
require "test_driver.pl";
-if (! eval { require "config-flags.pm" }) {
- # Some target systems don't create config-flags.pm
- %CONFIG_FLAGS = ();
+
+%CONFIG_FLAGS = ();
+
+my $statnm = "$FindBin::Bin/../config.status";
+if (open(my $fh, '<', $statnm)) {
+ while (my $line = <$fh>) {
+ $line =~ m/^[SD]\["([^\"]+)"\]=" *(.*)"/ and $CONFIG_FLAGS{$1} = $2;
+ }
+} else {
+ warn "Failed to open $statnm: $!";
}
# Some target systems might not have the POSIX module...