From b9b05b13d2731fa287fed5ffb602844828e3bb50 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 19 Dec 2013 14:29:52 +0100 Subject: swrap: Add documentation for SOCK_CLOEXEC in socket(). --- src/socket_wrapper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 0fcdb99..62e83ef 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -1929,6 +1929,12 @@ static int swrap_socket(int family, int type, int protocol) struct socket_info_fd *fi; int fd; int real_type = type; + + /* + * Remove possible addition flags passed to socket() so + * do not fail checking the type. + * See https://lwn.net/Articles/281965/ + */ #ifdef SOCK_CLOEXEC real_type &= ~SOCK_CLOEXEC; #endif -- cgit