[Gpg4win-commits] r1153 - in trunk: . patches patches/glib-2.20.0

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 8 20:00:37 CEST 2009


Author: marcus
Date: 2009-04-08 20:00:36 +0200 (Wed, 08 Apr 2009)
New Revision: 1153

Added:
   trunk/patches/glib-2.20.0/
   trunk/patches/glib-2.20.0/01-socket.patch
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
Log:
2009-04-08  Marcus Brinkmann  <marcus at g10code.de>

	* Makefile.am (EXTRA_DIST): Remove glib-2.9.2 patches and add
	patches/glib-2.20.0/01-socket.patch.
	* patches/glib-2.12.12/01-socket.patch: New file.
	* patches/glib-2.9.2-wk1/01-giowin32.patch,
	patches/glib-2.9.2-wk1/02-gspawn-w32.patch,
	patches/glib-2.9.2-wk1/03-gspawn-w32-fixup.patch,
	patches/glib-2.9.2-wk1/04-gspawn-w32-buffering.patch: Removed.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-04-08 18:00:03 UTC (rev 1152)
+++ trunk/ChangeLog	2009-04-08 18:00:36 UTC (rev 1153)
@@ -1,3 +1,13 @@
+2009-04-08  Marcus Brinkmann  <marcus at g10code.de>
+
+	* Makefile.am (EXTRA_DIST): Remove glib-2.9.2 patches and add
+	patches/glib-2.20.0/01-socket.patch.
+	* patches/glib-2.12.12/01-socket.patch: New file.
+	* patches/glib-2.9.2-wk1/01-giowin32.patch,
+	patches/glib-2.9.2-wk1/02-gspawn-w32.patch,
+	patches/glib-2.9.2-wk1/03-gspawn-w32-fixup.patch,
+	patches/glib-2.9.2-wk1/04-gspawn-w32-buffering.patch: Removed.
+
 2009-04-03  Marcus Brinkmann  <marcus at g10code.de>
 
 	* packages/packages.current: Update pinentry, libpng, glib, atk,

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2009-04-08 18:00:03 UTC (rev 1152)
+++ trunk/Makefile.am	2009-04-08 18:00:36 UTC (rev 1153)
@@ -24,13 +24,10 @@
 
 EXTRA_DIST = autogen.sh README.SVN \
         patches/pthreads-w32-2-7-0-release/01-make.patch \
-        patches/glib-2.9.2-wk1/01-giowin32.patch \
-        patches/glib-2.9.2-wk1/02-gspawn-w32.patch \
-        patches/glib-2.9.2-wk1/03-gspawn-w32-fixup.patch \
-        patches/glib-2.9.2-wk1/04-gspawn-w32-buffering.patch \
         patches/glib-2.12.12/01-giowin32.patch \
         patches/glib-2.12.12/02-gspawn-w32.patch \
         patches/glib-2.12.12/03-gspawn-w32-fixup.patch \
+        patches/glib-2.20.0/01-socket.patch \
 	patches/gpgme/01-gpg2.patch \
 	patches/gpgme-1.1.7/01-registry.patch \
 	patches/gpgme-1.1.7/02-extern-umlaute.patch \

Added: trunk/patches/glib-2.20.0/01-socket.patch
===================================================================
--- trunk/patches/glib-2.20.0/01-socket.patch	2009-04-08 18:00:03 UTC (rev 1152)
+++ trunk/patches/glib-2.20.0/01-socket.patch	2009-04-08 18:00:36 UTC (rev 1153)
@@ -0,0 +1,92 @@
+#! /bin/sh
+patch -p1 -f $* < $0
+exit $?
+
+Fix a couple of buglets in the I/O channel implementation.
+
+diff -rup glib-2.20.0-orig/glib/giowin32.c glib-2.20.0/glib/giowin32.c
+--- glib-2.20.0-orig/glib/giowin32.c	2009-03-13 05:09:59.000000000 +0100
++++ glib-2.20.0/glib/giowin32.c	2009-04-08 15:24:59.000000000 +0200
+@@ -285,7 +285,7 @@ g_io_channel_win32_init (GIOWin32Channel
+ 
+   channel->event_mask = 0;
+   channel->last_events = 0;
+-  channel->event = NULL;
++  channel->event = WSA_INVALID_EVENT;
+   channel->write_would_have_blocked = FALSE;
+   channel->ever_writable = FALSE;
+ }
+@@ -1144,7 +1144,7 @@ g_io_win32_free (GIOChannel *channel)
+ 	  g_free (emsg);
+ 	}
+ 
+-  if (win32_channel->event)
++  if (win32_channel->event != WSA_INVALID_EVENT)
+     if (!WSACloseEvent (win32_channel->event))
+       if (win32_channel->debug)
+ 	{
+@@ -1595,7 +1595,7 @@ g_io_win32_sock_create_watch (GIOChannel
+   
+   watch->condition = condition;
+ 
+-  if (win32_channel->event == 0)
++  if (win32_channel->event == WSA_INVALID_EVENT)
+     win32_channel->event = WSACreateEvent ();
+ 
+   watch->pollfd.fd = (gintptr) win32_channel->event;
+@@ -2161,7 +2161,54 @@ g_io_channel_win32_make_pollfd (GIOChann
+       break;
+ 
+     case G_IO_WIN32_SOCKET:
+-      fd->fd = (gintptr) WSACreateEvent ();
++      if (win32_channel->event == WSA_INVALID_EVENT)
++	win32_channel->event = WSACreateEvent ();
++      fd->fd = (gintptr) win32_channel->event;
++
++      if (fd->fd == (gintptr) WSA_INVALID_EVENT)
++	{
++	  gchar *emsg = g_win32_error_message (GetLastError ());
++	  
++	  g_error ("Error creating event: %s", emsg);
++	  g_free (emsg);
++	}
++      else
++	{
++	  int event_mask = 0;
++
++	  if (condition & G_IO_IN)
++	    event_mask |= (FD_READ | FD_ACCEPT);
++	  if (condition & G_IO_OUT)
++	    event_mask |= (FD_WRITE | FD_CONNECT);
++	  event_mask |= FD_CLOSE;
++
++	  ResetEvent ((WSAEVENT) fd->fd);
++
++	  if (win32_channel->debug)
++	    g_print ("WSAEventSelect(%d,%p,{%s})",
++		     win32_channel->fd, (HANDLE) fd->fd,
++		     event_mask_to_string (event_mask));
++	  if (WSAEventSelect (win32_channel->fd, (HANDLE) fd->fd,
++			      event_mask) == SOCKET_ERROR)
++	    if (win32_channel->debug)
++	      {
++		gchar *emsg = g_win32_error_message (WSAGetLastError ());
++
++		g_print (" failed: %s", emsg);
++		g_free (emsg);
++	      }
++	  if (win32_channel->debug)
++	    g_print ("\n");
++
++	  if ((event_mask & FD_WRITE) &&
++	      win32_channel->ever_writable &&
++	      !win32_channel->write_would_have_blocked)
++	    {
++	      if (win32_channel->debug)
++		g_print ("WSASetEvent(%p)\n", (WSAEVENT) fd->fd);
++	      WSASetEvent ((WSAEVENT) fd->fd);
++	    }
++	}
+       break;
+       
+     case G_IO_WIN32_WINDOWS_MESSAGES:


Property changes on: trunk/patches/glib-2.20.0/01-socket.patch
___________________________________________________________________
Name: svn:executable
   + *



More information about the Gpg4win-commits mailing list