sock: fixed build on cygwin

Cygwin doesn't have TCP_KEEPIDLE nor TCP_KEEPALIVE. Therefore, don't
change any tcp keepalive parameter on this system.
This commit is contained in:
Dmitry Podgorny
2016-05-11 11:28:45 +03:00
parent e83d0d6b62
commit 3e86987f5f

View File

@@ -132,7 +132,7 @@ int sock_set_keepalive(const sock_t sock, int timeout, int interval)
if (optval) {
#ifdef TCP_KEEPIDLE
ret = setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, &timeout, sizeof(timeout));
#else
#elif defined(TCP_KEEPALIVE)
/* QNX receives `struct timeval' as argument, but it seems OSX does int */
ret = setsockopt(sock, IPPROTO_TCP, TCP_KEEPALIVE, &timeout, sizeof(timeout));
#endif /* TCP_KEEPIDLE */