[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[libvirt] [PATCH 08/17] socketcompat.h: simplify, to match latest gnulib
- From: Jim Meyering <jim meyering net>
- To: libvir-list redhat com
- Cc: Jim Meyering <meyering redhat com>
- Subject: [libvirt] [PATCH 08/17] socketcompat.h: simplify, to match latest gnulib
- Date: Tue, 28 Oct 2008 12:21:25 +0100
From: Jim Meyering <meyering redhat com>
Now, sys/socket.h is always available, and errno works.
---
src/socketcompat.h | 29 +++++------------------------
1 files changed, 5 insertions(+), 24 deletions(-)
diff --git a/src/socketcompat.h b/src/socketcompat.h
index 51235f6..a06fe36 100644
--- a/src/socketcompat.h
+++ b/src/socketcompat.h
@@ -24,14 +24,7 @@
#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__ */
--
1.6.0.3.756.gb776d
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]