1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-14 21:47:19 +02:00

A whole bunch of changes to allow building for W32.

This commit is contained in:
Werner Koch 2004-12-15 14:15:54 +00:00
parent 53ae21e745
commit 69967b0412
32 changed files with 589 additions and 158 deletions

View file

@ -1,3 +1,16 @@
2004-12-15 Werner Koch <wk@g10code.com>
* gpg-agent.c [W32]: Various hacks to make it work.
* findkey.c (agent_write_private_key) [W32]: Adjust open call.
* call-scd.c (start_scd) [W32]: Don't check whether the daemon
didn't died. To hard to do under Windows.
(start_scd) [W32]: Disable sending of the event signal option.
* protect-tool.c (read_file, export_p12_file) [W32]: Use setmode
to get stdout and stin into binary mode.
2004-12-05 Moritz Schulte <moritz@g10code.com>
* query.c (start_pinentry): Allow CTRL be NULL.

View file

@ -215,7 +215,7 @@ start_scd (ctrl_t ctrl)
/* We better do a sanity check now to see whether it has
accidently died. */
#ifndef HAVE_W32_SYSTEM /* fixme */
#ifndef HAVE_W32_SYSTEM
pid = assuan_get_pid (scd_ctx);
if (pid != (pid_t)(-1) && pid
&& ((rc=waitpid (pid, NULL, WNOHANG))==-1 || (rc == pid)) )

View file

@ -33,7 +33,7 @@
#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
#endif
#endif /*HAVE_W32_SYSTEM*/
#include <unistd.h>
#include <signal.h>
#ifdef USE_GNU_PTH
@ -438,17 +438,18 @@ main (int argc, char **argv )
/* Libgcrypt requires us to register the threading model first.
Note that this will also do the pth_init. */
#if defined(USE_GNU_PTH) && !defined(HAVE_W32_SYSTEM)
#ifdef USE_GNU_PTH
# ifdef HAVE_W32_SYSTEM
pth_init ();
# else /*!HAVE_W32_SYSTEM*/
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
if (err)
{
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
gpg_strerror (err));
}
#endif /*USE_GNU_PTH && !HAVE_W32_SYSTEM*/
#ifdef HAVE_W32_SYSTEM
pth_init ();
#endif
# endif/*!HAVE_W32_SYSTEM*/
#endif /*USE_GNU_PTH*/
/* Check that the libraries are suitable. Do it here because
the option parsing may need services of the library. */
@ -716,12 +717,11 @@ main (int argc, char **argv )
}
/* Make sure that we have a default ttyname. */
#ifndef HAVE_W32_SYSTEM
if (!default_ttyname && ttyname (1))
default_ttyname = xstrdup (ttyname (1));
if (!default_ttytype && getenv ("TERM"))
default_ttytype = xstrdup (getenv ("TERM"));
#endif
if (pipe_server)
{ /* this is the simple pipe based server */

View file

@ -35,6 +35,9 @@
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#ifdef HAVE_DOSISH_SYSTEM
#include <fcntl.h> /* for setmode() */
#endif
#define JNLIB_NEED_LOG_LOGV
#include "agent.h"
@ -262,6 +265,9 @@ read_file (const char *fname, size_t *r_length)
size_t nread, bufsize = 0;
fp = stdin;
#ifdef HAVE_DOSISH_SYSTEM
setmode ( fileno(fp) , O_BINARY );
#endif
buf = NULL;
buflen = 0;
#define NCHUNK 8192
@ -975,6 +981,9 @@ export_p12_file (const char *fname)
if (!key)
return;
#ifdef HAVE_DOSISH_SYSTEM
setmode ( fileno (stdout) , O_BINARY );
#endif
fwrite (key, keylen, 1, stdout);
xfree (key);
}
@ -1056,12 +1065,12 @@ main (int argc, char **argv )
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
#ifdef __MINGW32__
#ifdef HAVE_W32_SYSTEM
opt_homedir = read_w32_registry_string ( NULL,
"Software\\GNU\\GnuPG", "HomeDir" );
#else
#else /*!HAVE_W32_SYSTEM*/
opt_homedir = getenv ("GNUPGHOME");
#endif
#endif /*!HAVE_W32_SYSTEM*/
if (!opt_homedir || !*opt_homedir)
opt_homedir = GNUPG_DEFAULT_HOMEDIR;
@ -1213,9 +1222,10 @@ get_passphrase (int promptno)
if (!pw)
{
if (err)
log_error ("error while asking for the passphrase\n");
log_error (_("error while asking for the passphrase: %s\n"),
gpg_strerror (err));
else
log_info ("cancelled\n");
log_info (_("cancelled\n"));
agent_exit (0);
}