--- old/giowin32.c	Fri Feb 24 03:21:01 2006
+++ new/giowin32.c	Fri Feb 24 03:24:33 2006
@@ -627,13 +627,17 @@
 		     channel->fd, watch->pollfd.fd,
 		     event_mask_to_string (event_mask));
 	  if (WSAEventSelect (channel->fd, (HANDLE) watch->pollfd.fd,
-			      event_mask) == SOCKET_ERROR)
-	    ;			/* What? */
-	  channel->event_mask = event_mask;
+			      event_mask) != SOCKET_ERROR)
+	  {
+		  channel->event_mask = event_mask;
 #if 0
-	  channel->event = watch->pollfd.fd;
+		  channel->event = watch->pollfd.fd;
 #endif
-	  channel->last_events = 0;
+		  channel->last_events = 0;
+	  } else
+	  {
+	    ;			/* What? */
+	  }
 	}
       break;
 
@@ -689,8 +693,9 @@
 		     condition_to_string (watch->condition),
 		     event_mask_to_string (events.lNetworkEvents));
 	  
-	  if (watch->pollfd.revents != 0 &&
-	      events.lNetworkEvents == 0 &&
+	  if (watch->pollfd.revents != 0 &&       /* event set */
+	      events.lNetworkEvents == 0 &&       /* no new network events */
+	      !(buffer_condition & G_IO_IN) &&    /* input buffer empty */
 	      !(channel->event_mask & FD_WRITE))
 	    {
 	      channel->event_mask = 0;
