bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] set_winsock_errno


From: Richard W.M. Jones
Subject: [PATCH] set_winsock_errno
Date: Thu, 26 Nov 2009 16:52:39 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

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?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v

Attachment: 0001-set_winsock_errno-Don-t-hide-the-original-Windows-er.patch
Description: Text document


reply via email to

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