bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] set_winsock_errno


From: Paolo Bonzini
Subject: Re: [PATCH] set_winsock_errno
Date: Thu, 26 Nov 2009 20:22:47 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4

On 11/26/2009 05:52 PM, Richard W.M. Jones wrote:

Currently any socket functions that are replaced by Gnulib on Win32
call set_winsock_errno.  This function reads the error from winsock
(WSAGetLastError) and sets errno to some corresponding Unix-ish
approximation.  The vast majority of functions (non-socket ones) still
require you to deal with GetLastError and Windows error codes.

Unfortunately set_winsock_errno also does this:

   static inline void
   set_winsock_errno (void)
   {
     int err = WSAGetLastError ();
     WSASetLastError (0);<-----

which means that no one else ever gets to read the underlying Windows
error code.  It also complicates error handling unnecessarily (even
more so than it is already on Windows).

Is there a reason to have that line or can it just be removed?

No, it's fine by me.  Do you have commit access?

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]