[ovs-dev] [PATCH 07/14] socket-util: drain_rcvbuf() for Windows.

Gurucharan Shetty shettyg at nicira.com
Wed Feb 19 23:36:18 UTC 2014


drain_rcvbuf() is currenlty called from netlink-socket.c and
netdev-linux.c. As of now, I don't see it being used for Windows.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 lib/socket-util.c |    2 ++
 lib/socket-util.h |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 2e3f4a9..88b8c24 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -345,6 +345,7 @@ check_connection_completion(int fd)
 #endif
 }
 
+#ifndef _WIN32
 /* Drain all the data currently in the receive queue of a datagram socket (and
  * possibly additional data).  There is no way to know how many packets are in
  * the receive queue, but we do know that the total number of bytes queued does
@@ -379,6 +380,7 @@ drain_rcvbuf(int fd)
     }
     return 0;
 }
+#endif
 
 /* Returns the size of socket 'sock''s receive buffer (SO_RCVBUF), or a
  * negative errno value if an error occurs. */
diff --git a/lib/socket-util.h b/lib/socket-util.h
index 6e55a4c..b4bd978 100644
--- a/lib/socket-util.h
+++ b/lib/socket-util.h
@@ -40,7 +40,9 @@ int lookup_hostname(const char *host_name, struct in_addr *);
 
 int get_socket_rcvbuf(int sock);
 int check_connection_completion(int fd);
+#ifndef _WIN32
 int drain_rcvbuf(int fd);
+#endif
 void drain_fd(int fd, size_t n_packets);
 int make_unix_socket(int style, bool nonblock,
                      const char *bind_path, const char *connect_path);
-- 
1.7.9.5




More information about the dev mailing list