From 5d582d4ba06495a95854c45828399f7edfe51a50 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 21 May 2001 06:16:00 +0000 Subject: Some VMS fixes sent by John Fowler. Fix: make flags on some lines of define/endef don't affect other lines --- ChangeLog | 13 +++++++++++++ arscan.c | 12 ++++++++---- commands.c | 2 +- function.c | 2 +- job.c | 12 ++++++++++-- tests/ChangeLog | 5 +++++ tests/scripts/variables/flavors | 4 ++-- 7 files changed, 40 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 966cb4a..377d480 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2001-05-02 Paul D. Smith + + * job.c (start_job_command): Don't add define/endef per-line flags + to the top-level flags setting. + +2001-04-03 Paul D. Smith + + * arscan.c (VMS_get_member_info,ar_scan) [VMS]: VMS sets the low + bit on error, so check for odd return values, not non-0 return + values. + (VMS_get_member_info): Calculate the timezone differences correctly. + Reported by John Fowler . + 2001-01-17 Paul D. Smith * variable.c (lookup_variable) [VMS]: When getting values from the diff --git a/arscan.c b/arscan.c index 5cadbe6..03ecb7c 100644 --- a/arscan.c +++ b/arscan.c @@ -66,7 +66,7 @@ VMS_get_member_info (module, rfa) status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc, &bufdesc.dsc$w_length, 0); - if (! status) + if (! (status & 1)) { error (NILF, _("lbr$set_module failed to extract module info, status = %d"), status); @@ -79,7 +79,11 @@ VMS_get_member_info (module, rfa) mhd = (struct mhddef *) filename; #ifdef __DECC - val = decc$fix_time (&mhd->mhd$l_datim); + /* John Fowler writes this is needed in his environment, + * but that decc$fix_time() isn't documented to work this way. Let me + * know if this causes problems in other VMS environments. + */ + val = decc$fix_time (&mhd->mhd$l_datim) + timezone - daylight*3600; #endif for (i = 0; i < module->dsc$w_length; i++) @@ -150,7 +154,7 @@ ar_scan (archive, function, arg) status = lbr$ini_control (&VMS_lib_idx, &func, &type, 0); - if (! status) + if (! (status & 1)) { error (NILF, _("lbr$ini_control failed with status = %d"),status); return -2; @@ -161,7 +165,7 @@ ar_scan (archive, function, arg) status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0); - if (! status) + if (! (status & 1)) { error (NILF, _("unable to open library `%s' to lookup member `%s'"), archive, (char *)arg); diff --git a/commands.c b/commands.c index 156fe06..67bba15 100644 --- a/commands.c +++ b/commands.c @@ -227,7 +227,7 @@ set_file_variables (file) } /* Chop CMDS up into individual command lines if necessary. - Also set the `lines_flag' and `any_recurse' members. */ + Also set the `lines_flags' and `any_recurse' members. */ void chop_commands (cmds) diff --git a/function.c b/function.c index 012d2e3..295d84b 100644 --- a/function.c +++ b/function.c @@ -128,7 +128,7 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent) unsigned int pattern_prepercent_len, pattern_postpercent_len; unsigned int replace_prepercent_len, replace_postpercent_len = 0; char *t; - int len; + unsigned int len; int doneany = 0; /* We call find_percent on REPLACE before checking PATTERN so that REPLACE diff --git a/job.c b/job.c index 615e4b3..0334290 100644 --- a/job.c +++ b/job.c @@ -895,8 +895,14 @@ start_job_command (child) ++p; } - /* Update the file's command flags with any new ones we found. */ - child->file->cmds->lines_flags[child->command_line - 1] |= flags; + /* Update the file's command flags with any new ones we found. We only + keep the COMMANDS_RECURSE setting. Even this isn't 100% correct; we are + now marking more commands recursive than should be in the case of + multiline define/endef scripts where only one line is marked "+". In + order to really fix this, we'll have to keep a lines_flags for every + actual line, after expansion. */ + child->file->cmds->lines_flags[child->command_line - 1] + |= flags & COMMANDS_RECURSE; /* Figure out an argument list from this command line. */ @@ -1580,6 +1586,8 @@ load_too_high () } user_access (); + DB (DB_JOBS, ("Current system load = %f (max requested = %f)\n", + load, max_load_average)); return load >= max_load_average; #endif } diff --git a/tests/ChangeLog b/tests/ChangeLog index 2a19bcb..a692f43 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2001-05-02 Paul D. Smith + + * scripts/variables/flavors: Test define/endef scripts where only + one of the command lines is quiet. + 2000-06-22 Paul D. Smith * scripts/options/dash-q: New file; test the -q option. Includes diff --git a/tests/scripts/variables/flavors b/tests/scripts/variables/flavors index 7642636..02dca0b 100644 --- a/tests/scripts/variables/flavors +++ b/tests/scripts/variables/flavors @@ -28,7 +28,7 @@ next: ; @echo $x$(space)$y define multi @echo hi -@echo there +echo there endef ifdef BOGUS @@ -47,7 +47,7 @@ close(MAKEFILE); # ------- &run_make_with_options($makefile, "", &get_logfile); -$answer = "hi\nthere\nHello\n"; +$answer = "hi\necho there\nthere\nHello\n"; &compare_output($answer, &get_logfile(1)); # TEST #2 -- cgit v1.2.3