X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/fe75e5033cd83f2ddc537457d96625044d168433..89e97516fedf1d0a7fe9c569bb569fa7ea872afa:/unix/uxnet.c diff --git a/unix/uxnet.c b/unix/uxnet.c index d01a44d9..2b3d8cbc 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -470,6 +470,8 @@ static int try_connect(Actual_Socket sock) goto ret; } + fcntl(s, F_SETFD, FD_CLOEXEC); + if (sock->oobinline) { int b = TRUE; setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *) &b, sizeof(b)); @@ -723,6 +725,8 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i return (Socket) ret; } + fcntl(s, F_SETFD, FD_CLOEXEC); + ret->oobinline = 0; setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(on));