[svn] gpgme - r1230 - in trunk: . assuan doc gpgme tests tests/gpgsm
svn author wk
cvs at cvs.gnupg.org
Thu Jul 12 17:25:52 CEST 2007
Author: wk
Date: 2007-07-12 17:25:20 +0200 (Thu, 12 Jul 2007)
New Revision: 1230
Modified:
trunk/assuan/ChangeLog
trunk/assuan/assuan-io.c
trunk/autogen.sh
trunk/doc/ChangeLog
trunk/doc/gpgme.texi
trunk/gpgme/ChangeLog
trunk/gpgme/gpgme.h
trunk/gpgme/version.c
trunk/tests/ChangeLog
trunk/tests/gpgsm/t-support.h
Log:
Changes for W32
Modified: trunk/assuan/ChangeLog
===================================================================
--- trunk/assuan/ChangeLog 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/assuan/ChangeLog 2007-07-12 15:25:20 UTC (rev 1230)
@@ -1,3 +1,8 @@
+2007-07-12 Werner Koch <wk at g10code.com>
+
+ * assuan-io.c (_assuan_simple_write, _assuan_simple_read): Map
+ ERROR_BROKEN_PIPE to EPIPE.
+
2007-07-08 Marcus Brinkmann <marcus at g10code.de>
* assuan-defs.h (struct assuan_context_s): Have partial peercred
Modified: trunk/assuan/assuan-io.c
===================================================================
--- trunk/assuan/assuan-io.c 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/assuan/assuan-io.c 2007-07-12 15:25:20 UTC (rev 1230)
@@ -65,7 +65,11 @@
n = ReadFile ((HANDLE)ctx->inbound.fd, buffer, size, &nread, NULL);
if (!n)
{
- errno = EIO; /* FIXME: We should have a proper mapping. */
+ switch (GetLastError())
+ {
+ case ERROR_BROKEN_PIPE: errno = EPIPE; break;
+ default: errno = EIO;
+ }
n = -1;
}
else
@@ -94,7 +98,12 @@
n = WriteFile ((HANDLE)ctx->outbound.fd, buffer, size, &nwrite, NULL);
if (!n)
{
- errno = EIO; /* FIXME: We should have a proper mapping. */
+ switch (GetLastError ())
+ {
+ case ERROR_BROKEN_PIPE:
+ case ERROR_NO_DATA: errno = EPIPE; break;
+ default: errno = EIO; break;
+ }
n = -1;
}
else
Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/autogen.sh 2007-07-12 15:25:20 UTC (rev 1230)
@@ -80,7 +80,7 @@
./configure --enable-maintainer-mode --prefix=${w32root} \
--host=i586-mingw32msvc --build=${build} \
- --with-gpg-error-prefix=${w32root} --without-gpgsm \
+ --with-gpg-error-prefix=${w32root} \
--enable-shared --enable-static --enable-w32-glib \
PKG_CONFIG_LIBDIR="$w32root/lib/pkgconfig"
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/doc/ChangeLog 2007-07-12 15:25:20 UTC (rev 1230)
@@ -1,3 +1,8 @@
+2007-07-12 Werner Koch <wk at g10code.com>
+
+ * gpgme.texi (Library Version Check): Add remark that the socket
+ layer will get initialized.
+
2007-06-05 Marcus Brinkmann <marcus at g10code.de>
* gpgme.texi (Advanced Key Editing): New section.
Modified: trunk/doc/gpgme.texi
===================================================================
--- trunk/doc/gpgme.texi 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/doc/gpgme.texi 2007-07-12 15:25:20 UTC (rev 1230)
@@ -572,8 +572,12 @@
version number. In either case, the function initializes some
sub-systems, and for this reason alone it must be invoked early in
your program, before you make use of the other functions in
- at acronym{GPGME}.
+ at acronym{GPGME}.
+As a side effect for W32 based systems, the socket layer will get
+initialized.
+
+
If @var{required_version} is @code{NULL}, the function returns a
pointer to a statically allocated string containing the version number
of the library.
Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/gpgme/ChangeLog 2007-07-12 15:25:20 UTC (rev 1230)
@@ -1,3 +1,8 @@
+2007-07-12 Werner Koch <wk at g10code.com>
+
+ * version.c (do_subsystem_inits) [W32]: Make sure that the socket
+ system has been started.
+
2007-07-10 Marcus Brinkmann <marcus at g10code.de>
* priv-io.h (_gpgme_io_dup): New prototype.
Modified: trunk/gpgme/gpgme.h
===================================================================
--- trunk/gpgme/gpgme.h 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/gpgme/gpgme.h 2007-07-12 15:25:20 UTC (rev 1230)
@@ -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.5-cvs1219"
+#define GPGME_VERSION "1.1.5-cvs1228"
Modified: trunk/gpgme/version.c
===================================================================
--- trunk/gpgme/version.c 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/gpgme/version.c 2007-07-12 15:25:20 UTC (rev 1230)
@@ -25,6 +25,9 @@
#include <string.h>
#include <limits.h>
#include <ctype.h>
+#ifdef HAVE_W32_SYSTEM
+#include <winsock2.h>
+#endif
#include "gpgme.h"
#include "priv-io.h"
@@ -41,7 +44,7 @@
must be done once at startup. We can not guarantee this using a
lock, though, because the semaphore subsystem needs to be
initialized itself before it can be used. So we expect that the
- user performs the necessary syncrhonization. */
+ user performs the necessary synchronization. */
static void
do_subsystem_inits (void)
{
@@ -54,7 +57,15 @@
_gpgme_io_subsystem_init ();
#ifdef HAVE_ASSUAN_H
assuan_set_assuan_err_source (GPG_ERR_SOURCE_GPGME);
-#endif
+#ifdef HAVE_W32_SYSTEM
+ /* We need to make sure that the sockets are initialized. */
+ {
+ WSADATA wsadat;
+
+ WSAStartup (0x202, &wsadat);
+ }
+#endif /*HAVE_W32_SYSTEM*/
+#endif /*HAVE_ASSUAN_H*/
done = 1;
}
Modified: trunk/tests/ChangeLog
===================================================================
--- trunk/tests/ChangeLog 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/tests/ChangeLog 2007-07-12 15:25:20 UTC (rev 1230)
@@ -1,3 +1,8 @@
+2007-07-12 Werner Koch <wk at g10code.com>
+
+ * gpgsm/t-support.h (init_gpgme) [W32]: Do not init the locales as
+ the constants are not available.
+
2007-02-26 Werner Koch <wk at g10code.com>
* gpg/t-verify.c (double_plaintext_sig): New.
Modified: trunk/tests/gpgsm/t-support.h
===================================================================
--- trunk/tests/gpgsm/t-support.h 2007-07-10 16:06:44 UTC (rev 1229)
+++ trunk/tests/gpgsm/t-support.h 2007-07-12 15:25:20 UTC (rev 1230)
@@ -91,9 +91,11 @@
gpgme_error_t err;
gpgme_check_version (NULL);
+#ifndef HAVE_W32_SYSTEM
setlocale (LC_ALL, "");
gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
+#endif
err = gpgme_engine_check_version (proto);
fail_if_err (err);
More information about the Gnupg-commits
mailing list