Skip to content

Instantly share code, notes, and snippets.

@saghul
Created February 9, 2014 10:31
Show Gist options
  • Save saghul/8897297 to your computer and use it in GitHub Desktop.
Save saghul/8897297 to your computer and use it in GitHub Desktop.
diff --git a/src/unix/tcp.c b/src/unix/tcp.c
index 2c36dc3..9c50b2d 100644
--- a/src/unix/tcp.c
+++ b/src/unix/tcp.c
@@ -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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment