diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-24 09:02:38 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-24 09:02:38 +0000 |
commit | c42a0324e4f2fa036f0fc6da785faad4b4d6714e (patch) | |
tree | 8f93c42e57fd687556b8d84293f274e2c6b2a4eb | |
parent | b99e6cbd055fbf8664ee510c2e60854d10c69d51 (diff) | |
download | libnodelay-c42a0324e4f2fa036f0fc6da785faad4b4d6714e.tar.gz |
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.
-rw-r--r-- | nodelay.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |