[Patch]: fhandler_socket::ioctl

Pierre A. Humblet pierre@phumblet.no-ip.org
Fri Mar 4 04:38:00 GMT 2005


This patch avoids the unnecessary creation of the win thread in window.cc
It fails to create the invisible window (error 5) when running exim
as a service under a privileged non SYSTEM account (XP home, SP 2).

Pierre

2005-03-04  Pierre Humblet <pierre.humblet@ieee.org>

	* fhandler_socket.cc (fhandler_socket::ioctl): Only cancel 
 	 WSAAsyncSelect when async mode is on.


Index: fhandler_socket.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_socket.cc,v
retrieving revision 1.150
diff -u -p -r1.150 fhandler_socket.cc
--- fhandler_socket.cc  28 Feb 2005 13:11:49 -0000      1.150
+++ fhandler_socket.cc  4 Mar 2005 00:32:57 -0000
@@ -1594,7 +1594,7 @@ fhandler_socket::ioctl (unsigned int cmd
       /* We must cancel WSAAsyncSelect (if any) before setting socket to
        * blocking mode
        */
-      if (cmd == FIONBIO && *(int *) p == 0)
+      if (cmd == FIONBIO && async_io () && *(int *) p == 0)
        WSAAsyncSelect (get_socket (), winmsg, 0, 0);
       res = ioctlsocket (get_socket (), cmd, (unsigned long *) p);
       if (res == SOCKET_ERROR)



More information about the Cygwin-patches mailing list