diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-03-27 11:55:22 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-03-27 11:55:22 +1100 |
commit | 533024be44861c8d2c8ba3232738c7d2dbbe2e4f (patch) | |
tree | 048c8bd52b50604e950d7976115ebaf42a0802ed /source4/heimdal/lib/roken/socket.c | |
parent | 679854384252e698b8f8c09d31eb15ed043c919b (diff) | |
download | samba-533024be44861c8d2c8ba3232738c7d2dbbe2e4f.tar.gz samba-533024be44861c8d2c8ba3232738c7d2dbbe2e4f.tar.bz2 samba-533024be44861c8d2c8ba3232738c7d2dbbe2e4f.zip |
s4:heimdal: import lorikeet-heimdal-201003262338 (commit f4e0dc17709829235f057e0e100d34802d3929ff)
Diffstat (limited to 'source4/heimdal/lib/roken/socket.c')
-rw-r--r-- | source4/heimdal/lib/roken/socket.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/heimdal/lib/roken/socket.c b/source4/heimdal/lib/roken/socket.c index bfc4b7102b..bd800ac5a1 100644 --- a/source4/heimdal/lib/roken/socket.c +++ b/source4/heimdal/lib/roken/socket.c @@ -315,3 +315,24 @@ socket_to_fd(rk_socket_t sock, int flags) return _open_osfhandle((intptr_t) sock, flags); #endif } + +#ifndef HEIMDAL_SMALLER +#undef socket + +int rk_socket(int, int, int); + +int +rk_socket(int domain, int type, int protocol) +{ + int s; + s = socket (domain, type, protocol); +#ifdef SOCK_CLOEXEC + if ((SOCK_CLOEXEC & type) && s < 0 && errno == EINVAL) { + type &= ~SOCK_CLOEXEC; + s = socket (domain, type, protocol); + } +#endif + return s; +} + +#endif /* HEIMDAL_SMALLER */ |