I've just discovered that using the saved sessions menu from Unix
[u/mdw/putty] / unix / uxnet.c
index d01a44d..2b3d8cb 100644 (file)
@@ -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));