unix: fix uv_tcp_nodelay return value in case of error

Fixes #1102
This commit is contained in:
Saúl Ibarra Corretgé 2014-02-10 09:00:46 +01:00
parent 419c2ffae7
commit 3901ec4976

View File

@ -232,7 +232,9 @@ int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {
int uv__tcp_nodelay(int fd, int on) {
return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)))
return -errno;
return 0;
}