[Gpg4win-commits] r1197 - in trunk: . patches/gnupg2-2.0.12

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jun 22 13:33:33 CEST 2009


Author: werner
Date: 2009-06-22 13:33:33 +0200 (Mon, 22 Jun 2009)
New Revision: 1197

Added:
   trunk/patches/gnupg2-2.0.12/02-pth-estream.patch
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
Log:
Fix trustlist.txt Problem


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-06-21 10:27:42 UTC (rev 1196)
+++ trunk/ChangeLog	2009-06-22 11:33:33 UTC (rev 1197)
@@ -1,3 +1,8 @@
+2009-06-22  Werner Koch  <wk at g10code.com>
+
+	* patches/gnupg2-2.0.12/02-pth-estream.patch: New.
+	* Makefile.am (EXTRA_DIST): Add it.
+
 2009-06-21  Marcus Brinkmann  <marcus at g10code.de>
 
 	* patches/gpgme-1.2.0/01-w32-io-threads.patch: New file.

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2009-06-21 10:27:42 UTC (rev 1196)
+++ trunk/Makefile.am	2009-06-22 11:33:33 UTC (rev 1197)
@@ -44,6 +44,7 @@
 	patches/gnupg2-2.0.9/04-ks-w32init.patch \
 	patches/gnupg2-2.0.9/05-w32-http.patch \
 	patches/gnupg2-2.0.12/01-scd-pw2.patch \
+	patches/gnupg2-2.0.12/02-pth-estream.patch \
 	patches/gpgol-0.9.91/01-gpgme.patch \
 	patches/claws-mail-3.7.1/01-fix-spaces-after-re.patch \
 	patches/claws-mail-3.7.1/02-3.7.1cvs22.patch \

Added: trunk/patches/gnupg2-2.0.12/02-pth-estream.patch
===================================================================
--- trunk/patches/gnupg2-2.0.12/02-pth-estream.patch	2009-06-21 10:27:42 UTC (rev 1196)
+++ trunk/patches/gnupg2-2.0.12/02-pth-estream.patch	2009-06-22 11:33:33 UTC (rev 1197)
@@ -0,0 +1,73 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+2009-06-22  Werner Koch  <wk at g10code.com>
+
+	* estream.c (es_pth_read, es_pth_write) [W32]: New.
+	(ESTREAM_SYS_READ, ESTREAM_SYS_WRITE) [HAVE_PTH]: Use them.
+
+
+Index: common/estream.c
+===================================================================
+--- common/estream.c	(revision 5047)
++++ common/estream.c	(working copy)
+@@ -138,8 +138,8 @@
+ /* Primitive system I/O.  */
+ 
+ #ifdef HAVE_PTH
+-# define ESTREAM_SYS_READ  pth_read
+-# define ESTREAM_SYS_WRITE pth_write
++# define ESTREAM_SYS_READ  es_pth_read
++# define ESTREAM_SYS_WRITE es_pth_write
+ #else
+ # define ESTREAM_SYS_READ  read
+ # define ESTREAM_SYS_WRITE write
+@@ -325,8 +325,47 @@
+   return ret;
+ }
+ 
++
+ 
++/*
++ * I/O Helper
++ *
++ * Unfortunately our Pth emulation for Windows expects system handles
++ * for pth_read and pth_write.  We use a simple approach to fix this:
++ * If the function returns an error we fall back to a vanilla read or
++ * write, assuming that we do I/O on a plain file where the operation
++ * can't block.
++ */
++#ifdef HAVE_PTH
++static int
++es_pth_read (int fd, void *buffer, size_t size)
++{
++# ifdef HAVE_W32_SYSTEM
++  int rc = pth_read (fd, buffer, size);
++  if (rc == -1 && errno == EINVAL)
++    rc = read (fd, buffer, size);
++  return rc;
++# else /*!HAVE_W32_SYSTEM*/
++  return pth_read (fd, buffer, size);
++# endif /* !HAVE_W32_SYSTEM*/
++}
+ 
++static int
++es_pth_write (int fd, const void *buffer, size_t size)
++{
++# ifdef HAVE_W32_SYSTEM
++  int rc = pth_write (fd, buffer, size);
++  if (rc == -1 && errno == EINVAL)
++    rc = write (fd, buffer, size);
++  return rc;
++# else /*!HAVE_W32_SYSTEM*/
++  return pth_write (fd, buffer, size);
++# endif /* !HAVE_W32_SYSTEM*/
++}
++#endif /*HAVE_PTH*/
++
++
++
+ /*
+  * Initialization.
+  */


Property changes on: trunk/patches/gnupg2-2.0.12/02-pth-estream.patch
___________________________________________________________________
Name: svn:executable
   + *



More information about the Gpg4win-commits mailing list