[svn] GnuPG - r5495 - in trunk: dirmngr g10

svn author wk cvs at cvs.gnupg.org
Thu Dec 9 12:50:23 CET 2010


Author: wk
Date: 2010-12-09 12:50:22 +0100 (Thu, 09 Dec 2010)
New Revision: 5495

Modified:
   trunk/dirmngr/ChangeLog
   trunk/dirmngr/dirmngr.c
   trunk/g10/ChangeLog
   trunk/g10/tdbio.c
Log:
Change dirmngr timer under W32CE.
Fix trustdb open problem under W32CE.


Modified: trunk/dirmngr/ChangeLog
===================================================================
--- trunk/dirmngr/ChangeLog	2010-12-02 18:40:03 UTC (rev 5494)
+++ trunk/dirmngr/ChangeLog	2010-12-09 11:50:22 UTC (rev 5495)
@@ -1,3 +1,7 @@
+2010-12-07  Werner Koch  <wk at g10code.com>
+
+	* dirmngr.c (TIMERTICK_INTERVAL) [W32CE]: Change to 60s.
+
 2010-11-23  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (dirmngr_LDFLAGS): Add extra_bin_ldflags.

Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2010-12-02 18:40:03 UTC (rev 5494)
+++ trunk/g10/ChangeLog	2010-12-09 11:50:22 UTC (rev 5495)
@@ -1,3 +1,9 @@
+2010-12-09  Werner Koch  <wk at g10code.com>
+
+	* tdbio.c (tdbio_set_dbname) [W32CE]: Take care of missing errno.
+	(strerror) [W32CE]: Dummy replacement.
+	(open_db) [W32CE]: Fall back to read-only on any error.
+
 2010-12-02  Werner Koch  <wk at g10code.com>
 
 	* misc.c (openpgp_cipher_algo_name): Use gnupg_cipher_algo_name.

Modified: trunk/dirmngr/dirmngr.c
===================================================================
--- trunk/dirmngr/dirmngr.c	2010-12-02 18:40:03 UTC (rev 5494)
+++ trunk/dirmngr/dirmngr.c	2010-12-09 11:50:22 UTC (rev 5495)
@@ -241,11 +241,15 @@
 
 /* The timer tick used for housekeeping stuff.  For Windows we use a
    longer period as the SetWaitableTimer seems to signal earlier than
-   the 2 seconds.  */
-#ifdef HAVE_W32_SYSTEM
-#define TIMERTICK_INTERVAL    (4)
+   the 2 seconds.  CHECK_OWN_SOCKET_INTERVAL defines how often we
+   check our own socket in standard socket mode.  If that value is 0
+   we don't check at all.   All values are in seconds. */
+#if defined(HAVE_W32CE_SYSTEM)
+# define TIMERTICK_INTERVAL         (60)
+#elif defined(HAVE_W32_SYSTEM)
+# define TIMERTICK_INTERVAL          (4)
 #else
-#define TIMERTICK_INTERVAL    (2)    /* Seconds.  */
+# define TIMERTICK_INTERVAL          (2)
 #endif
 
 /* This union is used to avoid compiler warnings in case a pointer is

Modified: trunk/g10/tdbio.c
===================================================================
--- trunk/g10/tdbio.c	2010-12-02 18:40:03 UTC (rev 5494)
+++ trunk/g10/tdbio.c	2010-12-09 11:50:22 UTC (rev 5495)
@@ -48,6 +48,13 @@
 #define MY_O_BINARY  0
 #endif
 
+/* We use ERRNO despite that the cegcc provided open/read/write
+   functions don't set ERRNO - at least show that ERRNO does not make
+   sense.  */
+#ifdef HAVE_W32CE_SYSTEM
+#undef strerror
+#define strerror(a) ("[errno not available]")
+#endif
 
 /****************
  * Yes, this is a very simple implementation. We should really
@@ -494,6 +501,13 @@
       fname = xstrdup (new_dbname);
 
     if( access( fname, R_OK ) ) {
+#ifdef HAVE_W32CE_SYSTEM
+      /* We know how the cegcc implementation of access works ;-). */
+      if (GetLastError () == ERROR_FILE_NOT_FOUND)
+        gpg_err_set_errno (ENOENT);
+      else
+        gpg_err_set_errno (EIO);
+#endif /*HAVE_W32CE_SYSTEM*/
 	if( errno != ENOENT ) {
 	    log_error( _("can't access `%s': %s\n"), fname, strerror(errno) );
 	    xfree(fname);
@@ -606,6 +620,9 @@
 #ifdef EROFS
                       || errno == EROFS
 #endif
+#ifdef HAVE_W32CE_SYSTEM
+                      || 1 /* cegcc's open does not set ERRNO. */
+#endif
                       )
       ) {
       db_fd = open (db_name, O_RDONLY | MY_O_BINARY );





More information about the Gnupg-commits mailing list