[Patch]: rlogin problems

Warren Young warren@etr-usa.com
Wed Jun 23 16:05:00 GMT 2004


Corinna Vinschen wrote:

>>	WSASetLastError last.
> 
> Thanks for this patch!  I've just applied it.  Very weird that this
> only affected 9x.

The difference happens because on the Win9x kernels, the Winsock errors 
are kind of a bastard hack-on to the system error subsystem 
(GetLastError() and such).  On WinNT they're integrated, but there are 
still limitations, such as FormatMessage() not working on WSA error 
codes.  With Win2K, WSA errors are totally integrated into the system 
error code scheme.

So, under Win2K+ and possibly WinNT as well, any system call should 
reset the system error code, as happens with errno on that other class 
of OSes.  That's why you have to set it after the WSACloseEvent() call.



More information about the Cygwin-patches mailing list