From c42a0324e4f2fa036f0fc6da785faad4b4d6714e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 24 Jul 2013 09:02:38 +0000 Subject: use mask to get SOCK_STREAM arg from socket syscall Linux may OR SOCK_CLOEXEC and SOCK_NONBLOCK, so we must mask those flags out to match SOCK_STREAM. --- nodelay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodelay.c b/nodelay.c index 265b0d6..afbb30e 100644 --- a/nodelay.c +++ b/nodelay.c @@ -55,7 +55,7 @@ int socket(int domain, int type, int protocol) if (fd >= 0 && protocol == IPPROTO_TCP && - type == SOCK_STREAM && + (type & SOCK_STREAM) == SOCK_STREAM && domain == PF_INET) { int orig_errno = errno; int optval = nodelay_value; -- cgit v1.2.3-24-ge0c7