mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-12 22:11:29 +02:00
On VMS use --batch by default if in batch mode.
This problem was identified and solved by Steven M. Schweda. Note that the vms specific code is not part of this repository. See http://antinode.info/dec/sw/gnupg.html for the VMS port.
This commit is contained in:
parent
a95143e225
commit
43c7d1c7cc
@ -1,3 +1,9 @@
|
|||||||
|
2011-09-12 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpg.c [__VMS]: Include vms.h.
|
||||||
|
(main) [__VMS]: Init batch mode according to actual process mode.
|
||||||
|
Suggested by Steven M. Schweda.
|
||||||
|
|
||||||
2011-08-09 Werner Koch <wk@g10code.com>
|
2011-08-09 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* keyedit.c (show_key_with_all_names): Remove unused var.
|
* keyedit.c (show_key_with_all_names): Remove unused var.
|
||||||
|
12
g10/gpg.c
12
g10/gpg.c
@ -39,6 +39,9 @@
|
|||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __VMS
|
||||||
|
# include "vms.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define INCLUDED_BY_MAIN_MODULE 1
|
#define INCLUDED_BY_MAIN_MODULE 1
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
@ -1872,6 +1875,15 @@ main (int argc, char **argv )
|
|||||||
opt.lock_once = 1;
|
opt.lock_once = 1;
|
||||||
#endif /* __riscos__ */
|
#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. This
|
||||||
|
* avoids that the process stops while trying to initialize the
|
||||||
|
* tty in batch mode. */
|
||||||
|
opt.batch = batch_mode_vms();
|
||||||
|
#endif
|
||||||
|
|
||||||
reopen_std();
|
reopen_std();
|
||||||
trap_unaligned();
|
trap_unaligned();
|
||||||
secmem_set_flags( secmem_get_flags() | 2 ); /* suspend warnings */
|
secmem_set_flags( secmem_get_flags() | 2 ); /* suspend warnings */
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2011-09-12 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* ttyio.c (init_ttyfp): Avoid endless loop due to a failed opening
|
||||||
|
of the tty. Suggested by Steven M. Schweda.
|
||||||
|
|
||||||
2011-08-09 Werner Koch <wk@g10code.com>
|
2011-08-09 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* pka.c (get_pka_info): Turn ANSWER into a union to avoid aliasing
|
* pka.c (get_pka_info): Turn ANSWER into a union to avoid aliasing
|
||||||
|
13
util/ttyio.c
13
util/ttyio.c
@ -185,7 +185,10 @@ init_ttyfp(void)
|
|||||||
#else
|
#else
|
||||||
ttyfp = batchmode? stderr : fopen( tty_get_ttyname (), "r+");
|
ttyfp = batchmode? stderr : fopen( tty_get_ttyname (), "r+");
|
||||||
if( !ttyfp ) {
|
if( !ttyfp ) {
|
||||||
log_error("cannot open `%s': %s\n",
|
ttyfp = stderr; /* Use stderr as fallback for log_error. */
|
||||||
|
initialized = 1; /* Make sure log_error won't try to init
|
||||||
|
the tty again. */
|
||||||
|
log_error("cannot open tty `%s': %s\n",
|
||||||
tty_get_ttyname (), strerror(errno) );
|
tty_get_ttyname (), strerror(errno) );
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
@ -258,7 +261,7 @@ tty_printf( const char *fmt, ... )
|
|||||||
|
|
||||||
va_start( arg_ptr, fmt ) ;
|
va_start( arg_ptr, fmt ) ;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
int n;
|
int n;
|
||||||
DWORD nwritten;
|
DWORD nwritten;
|
||||||
@ -267,7 +270,7 @@ tty_printf( const char *fmt, ... )
|
|||||||
if (!buf)
|
if (!buf)
|
||||||
log_bug("xtryvasprintf() failed\n");
|
log_bug("xtryvasprintf() failed\n");
|
||||||
n = strlen (buf);
|
n = strlen (buf);
|
||||||
|
|
||||||
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
|
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
|
||||||
log_fatal ("WriteConsole failed: %s", w32_strerror (0));
|
log_fatal ("WriteConsole failed: %s", w32_strerror (0));
|
||||||
if( n != nwritten )
|
if( n != nwritten )
|
||||||
@ -306,7 +309,7 @@ tty_fprintf (FILE *fp, const char *fmt, ... )
|
|||||||
|
|
||||||
va_start( arg_ptr, fmt ) ;
|
va_start( arg_ptr, fmt ) ;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
int n;
|
int n;
|
||||||
DWORD nwritten;
|
DWORD nwritten;
|
||||||
@ -315,7 +318,7 @@ tty_fprintf (FILE *fp, const char *fmt, ... )
|
|||||||
if (!buf)
|
if (!buf)
|
||||||
log_bug ("xtryvasprintf() failed\n");
|
log_bug ("xtryvasprintf() failed\n");
|
||||||
n = strlen (buf);
|
n = strlen (buf);
|
||||||
|
|
||||||
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
|
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
|
||||||
log_fatal ("WriteConsole failed: %s", w32_strerror (0));
|
log_fatal ("WriteConsole failed: %s", w32_strerror (0));
|
||||||
if (n != nwritten)
|
if (n != nwritten)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user