From 7c3eee80ba05a6843fda2c848422d1da04946267 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 13 Nov 2002 17:19:22 +0000 Subject: [PATCH] * exec.c [__CYGWIN32__]: Keep cygwin separate from Mingw32; we don't need it here as it behaves more like a Posix system. From Werner on stable branch. * passphrase.c (agent_get_passphrase): Ditto. From Werner on stable branch. * tdbio.c (MY_O_BINARY): Need binary mode with Cygwin. From Werner on stable branch. * g10.c, gpgv.c (main) [__CYGWIN32__]: Don't get the homedir from the registry. From Werner on stable branch. --- g10/ChangeLog | 13 +++++++++++++ g10/exec.c | 8 ++++---- g10/g10.c | 2 +- g10/gpgv.c | 2 +- g10/passphrase.c | 14 +++++++------- g10/tdbio.c | 4 ++-- 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 3c62bdd04..ee9d7a3af 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,18 @@ 2002-11-13 David Shaw + * exec.c [__CYGWIN32__]: Keep cygwin separate from Mingw32; + we don't need it here as it behaves more like a Posix system. + From Werner on stable branch. + + * passphrase.c (agent_get_passphrase): Ditto. From Werner on + stable branch. + + * tdbio.c (MY_O_BINARY): Need binary mode with Cygwin. From + Werner on stable branch. + + * g10.c, gpgv.c (main) [__CYGWIN32__]: Don't get the homedir from + the registry. From Werner on stable branch. + * keyedit.c (show_key_with_all_names_colon): Make --with-colons --edit display match the validity and trust of --with-colons --list-keys. diff --git a/g10/exec.c b/g10/exec.c index f220dd30f..27aa874f0 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -59,7 +59,7 @@ int set_exec_path(const char *path,int method) { return G10ERR_GENERAL; } char *mkdtemp(char *template); #endif -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) /* This is a nicer system() for windows that waits for programs to return before returning control to the caller. I hate helpful computers. */ @@ -136,7 +136,7 @@ static int make_tempdir(struct exec_info *info) if(tmp==NULL) { -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) tmp=m_alloc(256); if(GetTempPath(256,tmp)==0) strcpy(tmp,"c:\\windows\\temp"); @@ -173,7 +173,7 @@ static int make_tempdir(struct exec_info *info) sprintf(info->tempdir,"%s" DIRSEP_S "gpg-XXXXXX",tmp); -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) m_free(tmp); #endif @@ -499,7 +499,7 @@ int exec_read(struct exec_info *info) if(DBG_EXTPROG) log_debug("system() command is %s\n",info->command); -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) info->progreturn=win_system(info->command); #else info->progreturn=system(info->command); diff --git a/g10/g10.c b/g10/g10.c index d83589eb1..ba5ae58a2 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -1149,7 +1149,7 @@ main( int argc, char **argv ) opt.keyserver_options.include_subkeys=1; opt.keyserver_options.include_revoked=1; opt.trust_model=TM_OPENPGP; -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) set_homedir ( read_w32_registry_string( NULL, "Software\\GNU\\GnuPG", "HomeDir" )); #else diff --git a/g10/gpgv.c b/g10/gpgv.c index e0dfe92d2..4ed71b8c7 100644 --- a/g10/gpgv.c +++ b/g10/gpgv.c @@ -153,7 +153,7 @@ main( int argc, char **argv ) opt.trust_model = TM_ALWAYS; opt.batch = 1; - #if defined (__MINGW32__) || defined (__CYGWIN32__) + #if defined (__MINGW32__) opt.homedir = read_w32_registry_string( NULL, "Software\\GNU\\GnuPG", "HomeDir" ); #else opt.homedir = getenv("GNUPGHOME"); diff --git a/g10/passphrase.c b/g10/passphrase.c index 0b65e2e1c..77fa15cc3 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -97,7 +97,7 @@ static char *fd_passwd = NULL; static char *next_pw = NULL; static char *last_pw = NULL; -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) static int read_fd = 0; static int write_fd = 0; #endif @@ -176,7 +176,7 @@ read_passphrase_from_fd( int fd ) static int writen ( int fd, const void *buf, size_t nbytes ) { -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) DWORD nwritten, nleft = nbytes; while (nleft > 0) { @@ -219,7 +219,7 @@ writen ( int fd, const void *buf, size_t nbytes ) static int readn ( int fd, void *buf, size_t buflen, size_t *ret_nread ) { -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) DWORD nread, nleft = buflen; while (nleft > 0) { @@ -313,7 +313,7 @@ readline (int fd, char *buf, size_t buflen) #if !defined (__riscos__) -#if !defined (__MINGW32__) && !defined (__CYGWIN32__) +#if !defined (__MINGW32__) /* For the new Assuan protocol we may have to send options */ static int agent_send_option (int fd, const char *name, const char *value) @@ -418,7 +418,7 @@ agent_send_all_options (int fd) #endif return rc; } -#endif /*!__MINGW32__ && !__CYGWIN32__*/ +#endif /*!__MINGW32__*/ /* @@ -429,7 +429,7 @@ agent_send_all_options (int fd) static int agent_open (int *ret_prot) { -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) int fd; char *infostr, *p; HANDLE h; @@ -574,7 +574,7 @@ agent_open (int *ret_prot) static void agent_close ( int fd ) { -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (__MINGW32__) HANDLE h = OpenEvent(EVENT_ALL_ACCESS, FALSE, "gpg_agent"); ResetEvent(h); #else diff --git a/g10/tdbio.c b/g10/tdbio.c index 6da1021cd..c928b76ec 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -39,11 +39,11 @@ #include "trustdb.h" #include "tdbio.h" -#if defined(HAVE_DOSISH_SYSTEM) && !defined(__CYGWIN32__) +#if defined(HAVE_DOSISH_SYSTEM) #define ftruncate chsize #endif -#ifdef HAVE_DOSISH_SYSTEM +#if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__) #define MY_O_BINARY O_BINARY #else #define MY_O_BINARY 0