[libvirt] [PATCH 08/17] socketcompat.h: simplify, to match latest gnulib

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

 



From: Jim Meyering <meyering@xxxxxxxxxx>

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

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]