]> xenbits.xensource.com Git - libvirt.git/commitdiff
socketcompat.h: simplify, to match latest gnulib
authorJim Meyering <meyering@redhat.com>
Tue, 28 Oct 2008 17:47:23 +0000 (17:47 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 28 Oct 2008 17:47:23 +0000 (17:47 +0000)
Now, sys/socket.h is always available, and errno works.

ChangeLog
src/socketcompat.h

index 22544a66395a67a9f09083a65791c255480a25dc..1eac500a38e8f3927c920e8a946687fbcb25bfbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 28 12:12:41 +0100 2008 Jim Meyering <meyering@redhat.com>
+
+       socketcompat.h: simplify, to match latest gnulib
+       Now, sys/socket.h is always available, and errno works.
+
 Tue Oct 28 12:07:46 +0100 2008 Jim Meyering <meyering@redhat.com>
 
        updates from gnulib
index 51235f66bee21d323a37d4f1584d9548c9b3c9e7..a06fe36514c1b25c102119d97a2418bdf36554fa 100644 (file)
 #include <config.h>
 
 #include <errno.h>
-
-#ifndef HAVE_WINSOCK2_H                /* Unix & Cygwin. */
-
 #include <sys/socket.h>
-#include <sys/un.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
 
 static inline int
 socket_errno (void)
@@ -39,23 +32,11 @@ socket_errno (void)
   return errno;
 }
 
-#else                           /* MinGW & Win32 */
-
-#include <winsock2.h>
-
-/* Socket functions in Windows don't set errno.  Instead of using errno
- * to test for socket errors, call this function to get the errno.
- */
-static inline int
-socket_errno (void)
-{
-  return WSAGetLastError ();
-}
-
-/* Compatibility. */
-#define EWOULDBLOCK             WSAEWOULDBLOCK
-#define ECONNREFUSED            WSAECONNREFUSED
-
+#ifndef HAVE_WINSOCK2_H                /* Unix & Cygwin. */
+# include <sys/un.h>
+# include <net/if.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
 #endif /* HAVE_WINSOCK2_H */
 
 #endif /* __WINSOCKWRAPPER_H__ */