[svn] gpgme - r1493 - trunk/src
svn author wk
cvs at cvs.gnupg.org
Thu Oct 7 12:58:52 CEST 2010
Author: wk
Date: 2010-10-07 12:58:51 +0200 (Thu, 07 Oct 2010)
New Revision: 1493
Modified:
trunk/src/ChangeLog
trunk/src/debug.c
trunk/src/gpgme-tool.c
trunk/src/util.h
trunk/src/w32-util.c
Log:
Enable debugging feature for W32CE.
kFreeBSD portability fix.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2010-09-16 14:17:50 UTC (rev 1492)
+++ trunk/src/ChangeLog 2010-10-07 10:58:51 UTC (rev 1493)
@@ -1,3 +1,10 @@
+2010-10-07 Werner Koch <wk at g10code.com>
+
+ * gpgme-tool.c (ARGP_ERR_UNKNOWN): Use EDEADLK if available.
+
+ * w32-util.c (_gpgme_w32ce_get_debug_envvar) [W32CE]: New.
+ * debug.c (debug_init) [W32CE]: Use new function.
+
2010-09-16 Werner Koch <wk at g10code.com>
* import.c: Include "util.h".
Modified: trunk/src/debug.c
===================================================================
--- trunk/src/debug.c 2010-09-16 14:17:50 UTC (rev 1492)
+++ trunk/src/debug.c 2010-10-07 10:58:51 UTC (rev 1493)
@@ -115,12 +115,16 @@
char *e;
const char *s1, *s2;;
+#ifdef HAVE_W32CE_SYSTEM
+ e = _gpgme_w32ce_get_debug_envvar ();
+#else /*!HAVE_W32CE_SYSTEM*/
err = _gpgme_getenv ("GPGME_DEBUG", &e);
if (err)
{
UNLOCK (debug_lock);
return;
}
+#endif /*!HAVE_W32CE_SYSTEM*/
initialized = 1;
errfp = stderr;
Modified: trunk/src/gpgme-tool.c
===================================================================
--- trunk/src/gpgme-tool.c 2010-09-16 14:17:50 UTC (rev 1492)
+++ trunk/src/gpgme-tool.c 2010-10-07 10:58:51 UTC (rev 1493)
@@ -109,7 +109,11 @@
void *pstate;
};
-#define ARGP_ERR_UNKNOWN EDEADLOCK
+#ifdef EDEADLK
+# define ARGP_ERR_UNKNOWN EDEADLK /* POSIX */
+#else
+# define ARGP_ERR_UNKNOWN EDEADLOCK /* *GNU/kFreebsd does not define this) */
+#endif
#define ARGP_KEY_ARG 0
#define ARGP_KEY_ARGS 0x1000006
#define ARGP_KEY_END 0x1000001
Modified: trunk/src/util.h
===================================================================
--- trunk/src/util.h 2010-09-16 14:17:50 UTC (rev 1492)
+++ trunk/src/util.h 2010-10-07 10:58:51 UTC (rev 1493)
@@ -127,7 +127,10 @@
#ifdef HAVE_W32_SYSTEM
int _gpgme_mkstemp (int *fd, char **name);
const char *_gpgme_get_w32spawn_path (void);
-#endif
+#endif /*HAVE_W32_SYSTEM*/
+#ifdef HAVE_W32CE_SYSTEM
+char *_gpgme_w32ce_get_debug_envvar (void);
+#endif /*HAVE_W32CE_SYSTEM*/
/*-- Error codes not yet available in current gpg-error.h. --*/
#ifndef GPG_ERR_UNFINISHED
Modified: trunk/src/w32-util.c
===================================================================
--- trunk/src/w32-util.c 2010-09-16 14:17:50 UTC (rev 1492)
+++ trunk/src/w32-util.c 2010-10-07 10:58:51 UTC (rev 1493)
@@ -588,3 +588,24 @@
*name = tmpname;
return 0;
}
+
+
+
+#ifdef HAVE_W32CE_SYSTEM
+/* Return a malloced string with the replacement value for the
+ GPGME_DEBUG envvar. Caller must release. Returns NULL if not
+ set. */
+char *
+_gpgme_w32ce_get_debug_envvar (void)
+{
+ char *tmp;
+
+ tmp = w32_read_registry (L"\\Software\\GNU\\gpgme", L"debug");
+ if (tmp && !*tmp)
+ {
+ free (tmp);
+ tmp = NULL;
+ }
+ return NULL;
+}
+#endif /*HAVE_W32CE_SYSTEM*/
More information about the Gnupg-commits
mailing list