diff options
author | Zefram <zefram@fysh.org> | 2017-12-22 15:23:11 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-22 16:37:47 +0000 |
commit | a50ffd24fc4971e22bead1ab6f1eada47e042362 (patch) | |
tree | 3573a518663bfc54df935bbbf6b826dd966edaa8 /util.c | |
parent | 2cdf406af42834c46ef407517daab0734f7066fc (diff) | |
download | perl-a50ffd24fc4971e22bead1ab6f1eada47e042362.tar.gz |
mask off SOCK_CLOEXEC in socketpair() emulation
In the unlikely situation that we have SOCK_CLOEXEC but are emulating
socketpair(), having the bit set could confuse the emulation. It's not
worth actually implementing SOCK_CLOEXEC logic for this situation, so
just mask it off. The higher-level logic of PerlSock_socketpair_cloexec()
will handle the bit being ineffective.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -4176,6 +4176,10 @@ Perl_my_socketpair (int family, int type, int protocol, int fd[2]) { return -1; } +#ifdef SOCK_CLOEXEC + type &= ~SOCK_CLOEXEC; +#endif + #ifdef EMULATE_SOCKETPAIR_UDP if (type == SOCK_DGRAM) return S_socketpair_udp(fd); |