]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/uxproxy.c
Centralise calls to fcntl into functions that carefully check the
[PuTTY.git] / unix / uxproxy.c
index 9dee690e1d9c934c8eabeb97931081450000b39a..aa1ff07ab2bdb72e405a102ac3ec41a8a35086e8 100644 (file)
@@ -306,8 +306,8 @@ Socket platform_new_connection(SockAddr addr, char *hostname,
        dup2(from_cmd_pipe[1], 1);
        close(to_cmd_pipe[0]);
        close(from_cmd_pipe[1]);
-       fcntl(0, F_SETFD, 0);
-       fcntl(1, F_SETFD, 0);
+       noncloexec(0);
+       noncloexec(1);
        execl("/bin/sh", "sh", "-c", cmd, (void *)NULL);
        _exit(255);
     }