Some VMS fixes sent by John Fowler.
authorPaul Smith <psmith@gnu.org>
Mon, 21 May 2001 06:16:00 +0000 (06:16 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 21 May 2001 06:16:00 +0000 (06:16 +0000)
Fix: make flags on some lines of define/endef don't affect other lines

ChangeLog
arscan.c
commands.c
function.c
job.c
tests/ChangeLog
tests/scripts/variables/flavors

index 966cb4a..377d480 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-05-02  Paul D. Smith  <psmith@gnu.org>
+
+       * 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  <psmith@gnu.org>
+
+       * 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 <jfowler@nyx.net>.
+
 2001-01-17  Paul D. Smith  <psmith@gnu.org>
 
        * variable.c (lookup_variable) [VMS]: When getting values from the
index 5cadbe6..03ecb7c 100644 (file)
--- 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 <jfowler@nyx.net> 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);
index 156fe06..67bba15 100644 (file)
@@ -227,7 +227,7 @@ set_file_variables (file)
 }
 \f
 /* 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)
index 012d2e3..295d84b 100644 (file)
@@ -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 (file)
--- 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
 }
index 2a19bcb..a692f43 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-02  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/variables/flavors: Test define/endef scripts where only
+       one of the command lines is quiet.
+
 2000-06-22  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/options/dash-q: New file; test the -q option.  Includes
index 7642636..02dca0b 100644 (file)
@@ -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