[svn] GnuPG - r5296 - in trunk: . agent common g10 g13 kbx scd sm tools

svn author wk cvs at cvs.gnupg.org
Mon Mar 22 13:46:06 CET 2010


Author: wk
Date: 2010-03-22 13:46:05 +0100 (Mon, 22 Mar 2010)
New Revision: 5296

Modified:
   trunk/agent/gpg-agent.c
   trunk/agent/preset-passphrase.c
   trunk/agent/protect-tool.c
   trunk/autogen.sh
   trunk/common/ChangeLog
   trunk/common/Makefile.am
   trunk/common/argparse.c
   trunk/common/asshelp.c
   trunk/common/dns-cert.c
   trunk/common/estream.c
   trunk/common/estream.h
   trunk/common/exechelp.c
   trunk/common/http.c
   trunk/common/init.c
   trunk/common/init.h
   trunk/common/logging.c
   trunk/common/pka.c
   trunk/common/signal.c
   trunk/common/sysutils.c
   trunk/common/t-sysutils.c
   trunk/common/util.h
   trunk/configure.ac
   trunk/g10/gpg.c
   trunk/g10/gpgv.c
   trunk/g13/g13.c
   trunk/kbx/kbxutil.c
   trunk/scd/scdaemon.c
   trunk/sm/gpgsm.c
   trunk/sm/server.c
   trunk/tools/gpg-check-pattern.c
   trunk/tools/gpg-connect-agent.c
   trunk/tools/gpgconf.c
   trunk/tools/symcryptrun.c
Log:
More chnages to use estream.  Add a way to replace the standard
descriptors.


Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/ChangeLog	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1,5 +1,42 @@
+2010-03-22  Werner Koch  <wk at g10code.com>
+
+	* init.c (parse_std_file_handles): Change to use rendezvous ids.
+
 2010-03-15  Werner Koch  <wk at g10code.com>
 
+	* init.c (init_common_subsystems): Add args ARGCP and
+	ARGVP.  Change all callers to provide them.
+	(parse_std_file_handles): New.
+
+	* t-sysutils.c (rewind) [W32CE]: Provide a replacement.
+
+	* Makefile.am (module_tests) [W32CE]: Don't build t-exechelp for now.
+
+	* sysutils.c (gnupg_allow_set_foregound_window) [W32CE]: Don't
+	call AllowSetForegroundWindow.
+
+	* logging.c (isatty) [W32CE]: New.
+	(fun_writer, set_file_fd): Use estream even for the internal error
+	messages.
+	(log_string, log_flush): Make DUMMY_ARG_PTR static.
+
+2010-03-15  Werner Koch  <wk at g10code.com>
+
+	* asshelp.c (send_pinentry_environment) [!HAVE_SETLOCALE]: Do not
+	define OLD_LC.
+	* http.c (connect_server) [!USE_DNS_SRV]: Mark SRVTAG unused.
+	* dns-cert.c (get_dns_cert) [!USE_DNS_CERT]: Mark args unused.
+	* pka.c (get_pka_info): Ditto.
+
+	* signal.c (pause_on_sigusr): Remove.  It was used in ancient gpg
+	version with shared memory IPC.  Last caller removed on	2006-04-18.
+	(do_block) [W32]: Mark arg unused.
+
+	* exechelp.c (w32_open_null): Use CreateFileW.
+
+	* init.c (init_common_subsystems): Add args ARGCP and ARGVP.
+	Change all callers to pass them.
+
 	* logging.c (S_IRGRP, S_IROTH, S_IWGRP, S_IWOTH) [W32]: New.
 	(fun_writer, set_file_fd) [W32]: Disable socket code.
 

Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/agent/gpg-agent.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -589,7 +589,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
 
   /* Libgcrypt requires us to register the threading model first.
@@ -1385,7 +1385,7 @@
       HANDLE h, h2;
       SECURITY_ATTRIBUTES sa = { sizeof (SECURITY_ATTRIBUTES), NULL, TRUE};
 
-      /* We need to use manual reset evet object due to the way our
+      /* We need to use a manual reset event object due to the way our
          w32-pth wait function works: If we would use an automatic
          reset event we are not able to figure out which handle has
          been signaled because at the time we single out the signaled

Modified: trunk/agent/preset-passphrase.c
===================================================================
--- trunk/agent/preset-passphrase.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/agent/preset-passphrase.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -210,7 +210,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   opt_homedir = default_homedir ();
 

Modified: trunk/agent/protect-tool.c
===================================================================
--- trunk/agent/protect-tool.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/agent/protect-tool.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1025,7 +1025,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
     {

Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/autogen.sh	2010-03-22 12:46:05 UTC (rev 5296)
@@ -76,10 +76,12 @@
     fi
     build=`$tsdir/scripts/config.guess`
 
+    extraoptions=""
     case $myhostsub in
         ce)
           [ -z "$w32root" ] && w32root="$HOME/w32ce_root"
           toolprefixes="arm-mingw32ce"
+          extraoptions="--disable-scdaemon"
           ;;
         *)
           [ -z "$w32root" ] && w32root="$HOME/w32root"
@@ -124,7 +126,7 @@
 	     --with-regex=${w32root} \
              --with-pth-prefix=${w32root} \
              --with-adns=${w32root} \
-             --disable-g13 "$@"
+             ${extraoptions} --disable-g13 "$@"
     rc=$?
     exit $rc
 fi

Modified: trunk/common/Makefile.am
===================================================================
--- trunk/common/Makefile.am	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/Makefile.am	2010-03-22 12:46:05 UTC (rev 5296)
@@ -142,8 +142,11 @@
 if HAVE_W32_SYSTEM
 jnlib_tests += t-w32-reg
 endif
-module_tests = t-convert t-percent t-gettime t-sysutils t-sexputil t-exechelp \
+module_tests = t-convert t-percent t-gettime t-sysutils t-sexputil \
 	       t-session-env
+if !HAVE_W32CE_SYSTEM
+module_tests += t-exechelp
+endif
 module_maint_tests = t-helpfile t-b64
 
 

Modified: trunk/common/argparse.c
===================================================================
--- trunk/common/argparse.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/argparse.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1131,6 +1131,8 @@
   return p;
 }
 
+
+/* Set the usage handler.  This function is basically a constructor.  */
 void
 set_strusage ( const char *(*f)( int ) )
 {

Modified: trunk/common/asshelp.c
===================================================================
--- trunk/common/asshelp.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/asshelp.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -103,7 +103,9 @@
 
 {
   gpg_error_t err = 0;
+#if defined(HAVE_SETLOCALE)
   char *old_lc = NULL; 
+#endif
   char *dft_lc = NULL;
   const char *dft_ttyname;
   int iterator;

Modified: trunk/common/dns-cert.c
===================================================================
--- trunk/common/dns-cert.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/dns-cert.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -279,6 +279,13 @@
   return ret;
 #endif /*!USE_ADNS*/
 #else /* !USE_DNS_CERT */
+  (void)name;
+  (void)max_size;
+  (void)iobuf;
+  (void)fpr;
+  (void)fpr_len;
+  (void)url;
+
   return -1;
 #endif
 }

Modified: trunk/common/estream.c
===================================================================
--- trunk/common/estream.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/estream.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -245,6 +245,11 @@
 #define ESTREAM_LIST_LOCK   ESTREAM_MUTEX_LOCK   (estream_list_lock)
 #define ESTREAM_LIST_UNLOCK ESTREAM_MUTEX_UNLOCK (estream_list_lock)
 
+/* File descriptors registered to be used as the standard file handles. */
+static int custom_std_fds[3];
+static unsigned char custom_std_fds_valid[3];
+
+
 #ifndef EOPNOTSUPP
 # define EOPNOTSUPP ENOSYS
 #endif
@@ -2239,7 +2244,7 @@
 
 
 estream_t
-do_fdopen (int filedes, const char *mode, int no_close)
+do_fdopen (int filedes, const char *mode, int no_close, int with_locked_list)
 {
   unsigned int modeflags;
   int create_called;
@@ -2261,7 +2266,7 @@
 
   create_called = 1;
   err = es_create (&stream, cookie, filedes, estream_functions_fd,
-                   modeflags, 0);
+                   modeflags, with_locked_list);
 
  out:
 
@@ -2274,14 +2279,14 @@
 estream_t
 es_fdopen (int filedes, const char *mode)
 {
-  return do_fdopen (filedes, mode, 0);
+  return do_fdopen (filedes, mode, 0, 0);
 }
 
 /* A variant of es_fdopen which does not close FILEDES at the end.  */
 estream_t
 es_fdopen_nc (int filedes, const char *mode)
 {
-  return do_fdopen (filedes, mode, 1);
+  return do_fdopen (filedes, mode, 1, 0);
 }
 
 
@@ -2344,6 +2349,23 @@
 }
 
 
+/* Set custom standard descriptors to be used for stdin, stdout and
+   stderr.  This function needs to be called before any of the
+   standard streams are accessed.  */
+void
+_es_set_std_fd (int no, int fd)
+{
+  ESTREAM_LIST_LOCK;
+  if (no >= 0 && no < 3 && !custom_std_fds_valid[no])
+    {
+      custom_std_fds[no] = fd;
+      custom_std_fds_valid[no] = 1;
+    }
+  ESTREAM_LIST_UNLOCK;
+}
+
+
+/* Return the stream used for stdin, stdout or stderr.  */
 estream_t
 _es_get_std_stream (int fd)
 {
@@ -2361,6 +2383,17 @@
       }
   if (!stream)
     {
+      /* Standard stream not yet created.  We first try to create them
+         from registered file descriptors.  */
+      if (!fd && custom_std_fds_valid[0])
+        stream = do_fdopen (custom_std_fds[0], "r", 1, 1);
+      else if (fd == 1 && custom_std_fds_valid[1])
+        stream = do_fdopen (custom_std_fds[1], "a", 1, 1);
+      else if (custom_std_fds_valid[2])
+        stream = do_fdopen (custom_std_fds[1], "a", 1, 1);
+    }
+  if (!stream)
+    {
       /* Standard stream not yet created - do it now.  */
       if (!fd)
         stream = do_fpopen (stdin, "r", 1, 1);

Modified: trunk/common/estream.h
===================================================================
--- trunk/common/estream.h	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/estream.h	2010-03-22 12:46:05 UTC (rev 5296)
@@ -80,6 +80,7 @@
 #define es_fdopen_nc          _ESTREAM_PREFIX(es_fdopen_nc)
 #define es_fpopen             _ESTREAM_PREFIX(es_fpopen)
 #define es_fpopen_nc          _ESTREAM_PREFIX(es_fpopen_nc)
+#define _es_set_std_fd        _ESTREAM_PREFIX(_es_set_std_fd)
 #define _es_get_std_stream    _ESTREAM_PREFIX(_es_get_std_stream)
 #define es_freopen            _ESTREAM_PREFIX(es_freopen)
 #define es_fopencookie        _ESTREAM_PREFIX(es_fopencookie)
@@ -251,6 +252,7 @@
 int es_fileno (estream_t stream);
 int es_fileno_unlocked (estream_t stream);
 
+void _es_set_std_fd (int no, int fd);
 estream_t _es_get_std_stream (int fd);
 
 #define es_stdin  _es_get_std_stream (0)
@@ -364,7 +366,6 @@
                                     size_t *bytes_written);
 #endif /*GNUPG_MAJOR_VERSION*/
 
-
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/common/exechelp.c
===================================================================
--- trunk/common/exechelp.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/exechelp.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -381,10 +381,10 @@
 {
   HANDLE hfile;
 
-  hfile = CreateFile ("nul",
-                      for_write? GENERIC_WRITE : GENERIC_READ,
-                      FILE_SHARE_READ | FILE_SHARE_WRITE,
-                      NULL, OPEN_EXISTING, 0, NULL);
+  hfile = CreateFileW (L"nul",
+                       for_write? GENERIC_WRITE : GENERIC_READ,
+                       FILE_SHARE_READ | FILE_SHARE_WRITE,
+                       NULL, OPEN_EXISTING, 0, NULL);
   if (hfile == INVALID_HANDLE_VALUE)
     log_debug ("can't open `nul': %s\n", w32_strerror (-1));
   return hfile;

Modified: trunk/common/http.c
===================================================================
--- trunk/common/http.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/http.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1600,6 +1600,8 @@
 	  srvcount = getsrv (srvname, &serverlist);
 	}
     }
+#else
+  (void)srvtag;
 #endif /*USE_DNS_SRV*/
 
   if (!serverlist)

Modified: trunk/common/init.c
===================================================================
--- trunk/common/init.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/init.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -33,16 +33,23 @@
 
 #include "util.h"
 
+#ifdef HAVE_W32CE_SYSTEM
+#include <assuan.h>
+static void parse_std_file_handles (int *argcp, char ***argvp);
+#endif /*HAVE_W32CE_SYSTEM*/
 
+
 /* This function is to be used early at program startup to make sure
    that some subsystems are initialized.  This is in particular
    important for W32 to initialize the sockets so that our socket
    emulation code used directly as well as in libassuan may be used.
    It should best be called before any I/O is done so that setup
-   required for logging is ready.  CAUTION: This might be called while
-   running suid(root). */
+   required for logging is ready.  ARGCP and ARGVP are the addresses
+   of the parameters given to main.  This function may modify them.
+
+   CAUTION: This might be called while running suid(root).  */
 void
-init_common_subsystems (void)
+init_common_subsystems (int *argcp, char ***argvp)
 {
   /* Try to auto set the character set.  */
   set_native_charset (NULL); 
@@ -66,5 +73,85 @@
 
   /* Initialize the Estream library. */
   es_init ();
+
+  /* Special hack for Windows CE: We extract some options from arg
+     to setup the standard handles.  */
+#ifdef HAVE_W32CE_SYSTEM
+  parse_std_file_handles (argcp, argvp);
+#else
+  (void)argcp;
+  (void)argvp;
+#endif
 }
 
+
+
+/* WindowsCE uses a very strange way of handling the standard streams.
+   There is a function SetStdioPath to associate a standard stream
+   with a file or a device but what we really want is to use pipes as
+   standard streams.  Despite that we implement pipes using a device,
+   we would have some limitations on the number of open pipes due to
+   the 3 character limit of device file name.  Thus we don't take this
+   path.  Another option would be to install a file system driver with
+   support for pipes; this would allow us to get rid of the device
+   name length limitation.  However, with GnuPG we can get away be
+   redefining the standard streams and passing the handles to be used
+   on the command line.  This has also the advantage that it makes
+   creating a process much easier and does not require the
+   SetStdioPath set and restore game.  The caller needs to pass the
+   rendezvous ids using up to three options:
+
+     -&S0=<handle> -&S1=<handle> -&S2=<handle>
+
+   They are all optional but they must be the first arguments on the
+   command line.  Parsing stops as soon as an invalid option is found.
+   These rendezvous ids are then used to finish the pipe creation.*/
+#ifdef HAVE_W32CE_SYSTEM
+static void
+parse_std_file_handles (int *argcp, char ***argvp)
+{
+  int argc = *argcp;
+  char **argv = *argvp;
+  const char *s;
+  assuan_fd_t fd;
+  int i;
+  int fixup = 0;
+
+  if (!argc)
+    return;
+
+  for (argc--, argv++; argc; argc--, argv++)
+    {
+      s = *argv;
+      if (*s == '-' && s[1] == '&' && s[2] == 'S'
+          && (s[3] == '0' || s[3] == '1' || s[3] == '2')
+          && s[4] == '=' 
+          && (strchr ("-01234567890", s[5]) || !strcmp (s+5, "null")))
+        {
+          if (s[5] == 'n')
+            fd = ASSUAN_INVALID_FD;
+          else
+            fd = _assuan_w32ce_finish_pipe (atoi (s+5), s[3] != '0');
+          _es_set_std_fd (s[3] - '0', (int)fd);
+          fixup++;
+        }
+      else
+        break;
+    }
+
+  if (fixup)
+    {
+      argc = *argcp;
+      argc -= fixup;
+      *argcp = argc;
+
+      argv = *argvp;
+      for (i=1; i < argc; i++)
+        argv[i] = argv[i + fixup];
+      for (; i < argc + fixup; i++)
+        argv[i] = NULL;
+    }
+
+
+}
+#endif /*HAVE_W32CE_SYSTEM*/

Modified: trunk/common/init.h
===================================================================
--- trunk/common/init.h	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/init.h	2010-03-22 12:46:05 UTC (rev 5296)
@@ -20,7 +20,7 @@
 #ifndef GNUPG_COMMON_INIT_H
 #define GNUPG_COMMON_INIT_H
 
-void init_common_subsystems (void);
+void init_common_subsystems (int *argcp, char ***argvp);
 
 
 #endif /*GNUPG_COMMON_INIT_H*/

Modified: trunk/common/logging.c
===================================================================
--- trunk/common/logging.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/logging.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -52,6 +52,11 @@
 #endif
 
 
+#ifdef HAVE_W32CE_SYSTEM
+# define isatty(a)  (0)
+#endif
+
+
 static estream_t logstream;
 static int log_socket = -1;
 static char prefix_buffer[80];
@@ -138,9 +143,9 @@
       if (cookie->fd == -1)
         {
           if (!cookie->quiet && !running_detached
-              && isatty (fileno (stderr)))
-            fprintf (stderr, "failed to create socket for logging: %s\n",
-                     strerror(errno));
+              && isatty (es_fileno (es_stderr)))
+            es_fprintf (es_stderr, "failed to create socket for logging: %s\n",
+                        strerror(errno));
         }
       else
         {
@@ -156,9 +161,9 @@
           if (connect (cookie->fd, (struct sockaddr *) &addr, addrlen) == -1)
             {
               if (!cookie->quiet && !running_detached
-                  && isatty (fileno (stderr)))
-                fprintf (stderr, "can't connect to `%s': %s\n",
-                         cookie->name, strerror(errno));
+                  && isatty (es_fileno (es_stderr)))
+                es_fprintf (es_stderr, "can't connect to `%s': %s\n",
+                            cookie->name, strerror(errno));
               close (cookie->fd);
               cookie->fd = -1;
             }
@@ -193,14 +198,14 @@
     return (ssize_t)size; /* Okay. */ 
 
   if (!running_detached && cookie->fd != -1
-      && isatty (fileno (stderr)))
+      && isatty (es_fileno (es_stderr)))
     {
       if (*cookie->name)
-        fprintf (stderr, "error writing to `%s': %s\n",
-                 cookie->name, strerror(errno));
+        es_fprintf (es_stderr, "error writing to `%s': %s\n",
+                    cookie->name, strerror(errno));
       else
-        fprintf (stderr, "error writing to file descriptor %d: %s\n",
-                 cookie->fd, strerror(errno));
+        es_fprintf (es_stderr, "error writing to file descriptor %d: %s\n",
+                    cookie->fd, strerror(errno));
     }
   if (cookie->is_socket && cookie->fd != -1)
     {
@@ -246,7 +251,7 @@
   if (name && !strcmp (name, "-"))
     {
       name = NULL;
-      fd = fileno (stderr);
+      fd = es_fileno (es_stderr);
     }
 
 #ifndef HAVE_W32_SYSTEM
@@ -514,8 +519,10 @@
 log_string (int level, const char *string)
 {
   /* We need to provide a dummy arg_ptr.  volatile is needed to
-     suppress compiler warnings.  */
-  volatile va_list dummy_arg_ptr;
+     suppress compiler warnings.  The static is required for gcc 4.4
+     because it seems that it detects that a volatile automatic
+     variable is not any good if not initialized.  */
+  static volatile va_list dummy_arg_ptr;
 
   do_logv (level, 1, string, dummy_arg_ptr);
 }
@@ -597,7 +604,7 @@
 void
 log_flush (void)
 {
-  volatile va_list dummy_arg_ptr;
+  static volatile va_list dummy_arg_ptr;
   do_logv (JNLIB_LOG_CONT, 1, NULL, dummy_arg_ptr);
 }
 

Modified: trunk/common/pka.c
===================================================================
--- trunk/common/pka.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/pka.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -274,6 +274,8 @@
 char *
 get_pka_info (const char *address, unsigned char *fpr)
 {
+  (void)address;
+  (void)fpr;
   return NULL;
 }
 #endif /* !USE_DNS_PKA */

Modified: trunk/common/signal.c
===================================================================
--- trunk/common/signal.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/signal.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -170,38 +170,13 @@
 #endif
 }
 
-void
-gnupg_pause_on_sigusr (int which)
-{
-#ifndef HAVE_DOSISH_SYSTEM
-# ifdef HAVE_SIGPROCMASK
-  sigset_t mask, oldmask;
 
-  assert (which == 1);
-  sigemptyset( &mask );
-  sigaddset( &mask, SIGUSR1 );
-  
-  sigprocmask( SIG_BLOCK, &mask, &oldmask );
-  while (!caught_sigusr1)
-    sigsuspend (&oldmask);
-  caught_sigusr1 = 0;
-  sigprocmask (SIG_UNBLOCK, &mask, NULL);
-# else 
-  assert (which == 1);
-  sighold (SIGUSR1);
-  while (!caught_sigusr1)
-    sigpause(SIGUSR1);
-  caught_sigusr1 = 0;
-  sigrelease(SIGUSR1);
-# endif /*!HAVE_SIGPROCMASK*/
-#endif
-}
-
-
 static void
-do_block( int block )
+do_block (int block)
 {
-#ifndef HAVE_DOSISH_SYSTEM
+#ifdef HAVE_DOSISH_SYSTEM
+  (void)block;
+#else /*!HAVE_DOSISH_SYSTEM*/
   static int is_blocked;
 #ifdef HAVE_SIGPROCMASK
   static sigset_t oldmask;
@@ -247,7 +222,7 @@
       is_blocked = 0;
     }
 #endif /*!HAVE_SIGPROCMASK*/
-#endif /*HAVE_DOSISH_SYSTEM*/
+#endif /*!HAVE_DOSISH_SYSTEM*/
 }
 
 

Modified: trunk/common/sysutils.c
===================================================================
--- trunk/common/sysutils.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/sysutils.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -498,7 +498,7 @@
   if (!pid)
     log_info ("%s called with invalid pid %lu\n",
               "gnupg_allow_set_foregound_window", (unsigned long)pid);
-#ifdef HAVE_W32_SYSTEM  
+#if defined(HAVE_W32_SYSTEM) && !defined(HAVE_W32CE_SYSTEM)
   else if (!AllowSetForegroundWindow ((pid_t)pid == (pid_t)(-1)?ASFW_ANY:pid))
     log_info ("AllowSetForegroundWindow(%lu) failed: %s\n",
                (unsigned long)pid, w32_strerror (-1));

Modified: trunk/common/t-sysutils.c
===================================================================
--- trunk/common/t-sysutils.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/t-sysutils.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -24,6 +24,10 @@
 #include "util.h"
 #include "sysutils.h"
 
+#ifdef HAVE_W32CE_SYSTEM
+# define rewind(f) do { fseek (f, 0, SEEK_SET); clearerr (f); } while (0)
+#endif
+
 #define pass()  do { ; } while(0)
 #define fail(a)  do { fprintf (stderr, "%s:%d: test %d failed\n",\
                                __FILE__,__LINE__, (a));          \

Modified: trunk/common/util.h
===================================================================
--- trunk/common/util.h	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/common/util.h	2010-03-22 12:46:05 UTC (rev 5296)
@@ -141,7 +141,6 @@
 
 /*-- signal.c --*/
 void gnupg_init_signals (int mode, void (*fast_cleanup)(void));
-void gnupg_pause_on_sigusr (int which);
 void gnupg_block_all_signals (void);
 void gnupg_unblock_all_signals (void);
 

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/configure.ac	2010-03-22 12:46:05 UTC (rev 5296)
@@ -484,7 +484,7 @@
 
 # We need to compile and run a program on the build machine.  A
 # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
-# the AC archive is broken for autoconf 2.57.  Given that tehre is no
+# the AC archive is broken for autoconf 2.57.  Given that there is no
 # newer version of that macro, we assume that it is also broken for
 # autoconf 2.61 and thus we use a simple but usually sufficient
 # approach.

Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/g10/gpg.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1940,7 +1940,7 @@
 
     /* Make sure that our subsystems are ready.  */
     i18n_init();
-    init_common_subsystems ();
+    init_common_subsystems (&argc, &argv);
 
     /* Check that the libraries are suitable.  Do it right here because the
        option parsing may need services of the library.  */

Modified: trunk/g10/gpgv.c
===================================================================
--- trunk/g10/gpgv.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/g10/gpgv.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -148,7 +148,7 @@
   
   /* Make sure that our subsystems are ready.  */
   i18n_init();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
   
   gnupg_init_signals (0, NULL);
 

Modified: trunk/g13/g13.c
===================================================================
--- trunk/g13/g13.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/g13/g13.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -359,7 +359,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   /* Libgcrypt requires us to register the threading model first.
      Note that this will also do the pth_init. */

Modified: trunk/kbx/kbxutil.c
===================================================================
--- trunk/kbx/kbxutil.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/kbx/kbxutil.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -419,7 +419,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   /* Check that the libraries are suitable.  Do it here because
      the option parsing may need services of the library.  */

Modified: trunk/scd/scdaemon.c
===================================================================
--- trunk/scd/scdaemon.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/scd/scdaemon.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -406,7 +406,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
 
   /* Libgcrypt requires us to register the threading model first.

Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/sm/gpgsm.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -911,7 +911,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   /* Check that the libraries are suitable.  Do it here because the
      option parse may need services of the library */

Modified: trunk/sm/server.c
===================================================================
--- trunk/sm/server.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/sm/server.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1248,7 +1248,7 @@
 
   /* We use a pipe based server so that we can work from scripts.
      assuan_init_pipe_server will automagically detect when we are
-     called with a socketpair and ignore FIELDES in this case. */
+     called with a socketpair and ignore FILEDES in this case. */
   filedes[0] = assuan_fdopen (0);
   filedes[1] = assuan_fdopen (1);
   rc = assuan_new (&ctx);

Modified: trunk/tools/gpg-check-pattern.c
===================================================================
--- trunk/tools/gpg-check-pattern.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/tools/gpg-check-pattern.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -169,7 +169,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   /* We need Libgcrypt for hashing.  */
   if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )

Modified: trunk/tools/gpg-connect-agent.c
===================================================================
--- trunk/tools/gpg-connect-agent.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/tools/gpg-connect-agent.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -1158,7 +1158,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   assuan_set_gpg_err_source (0);
 

Modified: trunk/tools/gpgconf.c
===================================================================
--- trunk/tools/gpgconf.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/tools/gpgconf.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -152,7 +152,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   /* Parse the command line. */
   pargs.argc  = &argc;

Modified: trunk/tools/symcryptrun.c
===================================================================
--- trunk/tools/symcryptrun.c	2010-03-15 13:08:51 UTC (rev 5295)
+++ trunk/tools/symcryptrun.c	2010-03-22 12:46:05 UTC (rev 5296)
@@ -884,7 +884,7 @@
 
   /* Make sure that our subsystems are ready.  */
   i18n_init();
-  init_common_subsystems ();
+  init_common_subsystems (&argc, &argv);
 
   opt.homedir = default_homedir ();
 




More information about the Gnupg-commits mailing list