[ovs-dev] [PATCH 2/4] stream-tcp: Use closesocket instead of close for sockets.
Gurucharan Shetty
shettyg at nicira.com
Fri Mar 28 16:10:44 UTC 2014
We should use closesocket() while closing sockets so that
closing sockets work fine on both POSIX and Windows.
(In POSIX, we #define closesocket close)
Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
lib/stream-tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index 4cd4e6f..d62e9c3 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
@@ -58,7 +58,7 @@ new_tcp_stream(const char *name, int fd, int connect_status,
int error = sock_errno();
VLOG_ERR("%s: setsockopt(TCP_NODELAY): %s",
name, sock_strerror(error));
- close(fd);
+ closesocket(fd);
return error;
}
--
1.7.9.5
More information about the dev
mailing list