[svn] gpgme - r1150 - in trunk: . gpgme
svn author wk
cvs at cvs.gnupg.org
Thu Jan 5 09:58:51 CET 2006
Author: wk
Date: 2006-01-05 09:58:50 +0100 (Thu, 05 Jan 2006)
New Revision: 1150
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/gpgme/ChangeLog
trunk/gpgme/debug.c
trunk/gpgme/debug.h
trunk/gpgme/gpgme.h
trunk/gpgme/w32-glib-io.c
Log:
Minor glib fix.
Pretty up debug output.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/ChangeLog 2006-01-05 08:58:50 UTC (rev 1150)
@@ -1,3 +1,8 @@
+2006-01-05 Werner Koch <wk at g10code.com>
+
+ * configure.ac: Test for inline feature.
+ (AH_BOTTOM): New to define the pure attribute.
+
2006-01-03 Werner Koch <wk at g10code.com>
* configure.ac: Append SVN revision to the version.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/configure.ac 2006-01-05 08:58:50 UTC (rev 1150)
@@ -180,6 +180,7 @@
# Type checks.
+AC_C_INLINE
AC_CHECK_SIZEOF(unsigned int)
AC_SYS_LARGEFILE
AC_TYPE_OFF_T
@@ -507,7 +508,16 @@
#endif
])
+AH_BOTTOM([
+/* Definition of GCC specific attributes. */
+#if __GNUC__ > 2
+# define GPGME_GCC_A_PURE __attribute__ ((__pure__))
+#else
+# define GPGME_GCC_A_PURE
+#endif
+])
+
# Substitution used for gpgme-config
GPGME_CONFIG_LIBS="-lgpgme"
GPGME_CONFIG_CFLAGS=""
Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/gpgme/ChangeLog 2006-01-05 08:58:50 UTC (rev 1150)
@@ -1,3 +1,10 @@
+2006-01-04 Werner Koch <wk at g10code.com>
+
+ * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
+
+ * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
+ statements. Disable error return for failed nonblocking call.
+
2006-01-03 Marcus Brinkmann <marcus at g10code.de>
* w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
Modified: trunk/gpgme/debug.c
===================================================================
--- trunk/gpgme/debug.c 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/gpgme/debug.c 2006-01-05 08:58:50 UTC (rev 1150)
@@ -1,6 +1,6 @@
/* debug.c - helpful output in desperate situations
Copyright (C) 2000 Werner Koch (dd9jn)
- Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
This file is part of GPGME.
Modified: trunk/gpgme/debug.h
===================================================================
--- trunk/gpgme/debug.h 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/gpgme/debug.h 2006-01-05 08:58:50 UTC (rev 1150)
@@ -1,5 +1,5 @@
/* debug.h - interface to debugging functions
- Copyright (C) 2002, 2004 g10 Code GmbH
+ Copyright (C) 2002, 2004, 2005 g10 Code GmbH
This file is part of GPGME.
@@ -21,6 +21,20 @@
#ifndef DEBUG_H
#define DEBUG_H
+#include <string.h>
+
+/* Remove path components from filenames (i.e. __FILE__) for cleaner
+ logs. */
+static inline const char *_gpgme_debug_srcname (const char *file)
+ GPGME_GCC_A_PURE;
+
+static inline const char *
+_gpgme_debug_srcname (const char *file)
+{
+ const char *s = strrchr (file, '/');
+ return s? s+1:file;
+}
+
/* Log the formatted string FORMAT at debug level LEVEL or higher. */
void _gpgme_debug (int level, const char *format, ...);
@@ -76,22 +90,26 @@
#else
/* This finally works everywhere, horror. */
#define DEBUG0(fmt) \
- _gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__))
+ _gpgme_debug (1, "%s:%s: " fmt, _gpgme_debug_srcname (__FILE__), \
+ XSTRINGIFY (__LINE__))
#define DEBUG1(fmt,a) \
- _gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__), (a))
+ _gpgme_debug (1, "%s:%s: " fmt, _gpgme_debug_srcname (__FILE__), \
+ XSTRINGIFY (__LINE__), (a))
#define DEBUG2(fmt,a,b) \
- _gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__), (a), (b))
+ _gpgme_debug (1, "%s:%s: " fmt, _gpgme_debug_srcname (__FILE__), \
+ XSTRINGIFY (__LINE__), (a), (b))
#define DEBUG3(fmt,a,b,c) \
- _gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__), (a), (b), \
- (c))
+ _gpgme_debug (1, "%s:%s: " fmt, _gpgme_debug_srcname (__FILE__), \
+ XSTRINGIFY (__LINE__), (a), (b), (c))
#define DEBUG4(fmt,a,b,c,d) \
- _gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__), (a), (b), \
- (c), (d))
+ _gpgme_debug (1, "%s:%s: " fmt, _gpgme_debug_srcname (__FILE__), \
+ XSTRINGIFY (__LINE__), (a), (b), (c), (d))
#define DEBUG5(fmt,a,b,c,d,e) \
- _gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__), (a), (b), \
- (c), (d), (e))
+ _gpgme_debug (1, "%s:%s: " fmt, _gpgme_debug_srcname (__FILE__), \
+ XSTRINGIFY (__LINE__), (a), (b), (c), (d), (e))
#define DEBUG_BEGIN(hlp,lvl,fmt) \
- _gpgme_debug_begin (&(hlp), lvl, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__))
+ _gpgme_debug_begin (&(hlp), lvl, "%s:%s: " fmt, \
+ _gpgme_debug_srcname (__FILE__), XSTRINGIFY (__LINE__))
#define DEBUG_ADD0(hlp,fmt) \
_gpgme_debug_add (&(hlp), fmt)
#define DEBUG_ADD1(hlp,fmt,a) \
Modified: trunk/gpgme/gpgme.h
===================================================================
--- trunk/gpgme/gpgme.h 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/gpgme/gpgme.h 2006-01-05 08:58:50 UTC (rev 1150)
@@ -72,7 +72,7 @@
AM_PATH_GPGME macro) check that this header matches the installed
library. Warning: Do not edit the next line. configure will do
that for you! */
-#define GPGME_VERSION "1.1.1-cvs"
+#define GPGME_VERSION "1.1.1-cvs1149"
Modified: trunk/gpgme/w32-glib-io.c
===================================================================
--- trunk/gpgme/w32-glib-io.c 2006-01-03 18:40:33 UTC (rev 1149)
+++ trunk/gpgme/w32-glib-io.c 2006-01-05 08:58:50 UTC (rev 1150)
@@ -290,6 +290,7 @@
else
_close (fd);
+
return 0;
}
@@ -313,21 +314,25 @@
{
GIOChannel *chan;
GIOStatus status;
-
+
chan = find_channel (fd, 0);
if (!chan)
{
+ DEBUG1 ("set nonblocking for fd %d failed: channel not found", fd);
errno = EIO;
return -1;
}
- status = g_io_channel_set_flags (chan,
+ status = g_io_channel_set_flags (chan,
g_io_channel_get_flags (chan) |
G_IO_FLAG_NONBLOCK, NULL);
if (status != G_IO_STATUS_NORMAL)
{
- errno = EIO;
- return -1;
+ /* glib 1.9.2 does not implement set_flags and returns an error. */
+ DEBUG2 ("set nonblocking for fd %d failed: status=%d - ignored",
+ fd, status);
+/* errno = EIO; */
+/* return -1; */
}
return 0;
More information about the Gnupg-commits
mailing list