GnuPG 1.4.11 v. VMS batch mode

Steven M. Schweda sms at antinode.info
Fri Sep 9 05:52:53 CEST 2011


>    On VMS, it should be relatively easy to check the process mode during
> initialization, and set the "--batch" flag ("batchmode"?) automatically
> for a batch job.  I haven't yet thought of a good reason not to do this,
> but I'm always open to a good counter-argument.

   This seems to work (with the associated changes to various
VMS-specific files in the "vms" and "vmslib" subdirectories:

--- g10/gpg.c_orig	2010-07-05 04:17:37 -0500
+++ g10/gpg.c	2011-09-08 13:37:06 -0500
@@ -40,6 +40,10 @@
 #include <windows.h>
 #endif
 
+#ifdef __VMS
+# include "vms.h"
+#endif
+
 #define INCLUDED_BY_MAIN_MODULE 1
 #include "packet.h"
 #include "iobuf.h"
@@ -1872,6 +1876,14 @@
     opt.lock_once = 1;
 #endif /* __riscos__ */
 
+#ifdef __VMS
+    /* On VMS, set the default value of the "--[no-]batch" flag
+     * according to the actual process mode.  The user can override this
+     * with an explicit command-line "--[no-]batch" option.
+     */
+    opt.batch = batch_mode_vms();
+#endif
+
     reopen_std();
     trap_unaligned();
     secmem_set_flags( secmem_get_flags() | 2 ); /* suspend warnings */


   I thought about trying to hide this stuff in some VMS-specific place,
to avoid adding VMS-specific clutter in the main thing, but it made more
sense to me to set opt.batch this way, in the same neighborhood as the
normal opt.xxxx-setting code.

   Comments welcome, as usual.

------------------------------------------------------------------------

   Steven M. Schweda               sms at antinode-info
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547



More information about the Gnupg-devel mailing list