]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/uxagentc.c
Better not forget to make sure GTK1 doesn't break.
[PuTTY.git] / unix / uxagentc.c
index 826e4394b6d6f7e5b9bb23f547c8129ca0245ffc..3605c60124316947ab346975086eccf463fb1cd3 100644 (file)
@@ -8,6 +8,7 @@
 #include <unistd.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#include <fcntl.h>
 
 #include "putty.h"
 #include "misc.h"
@@ -121,6 +122,8 @@ int agent_query(void *in, int inlen, void **out, int *outlen,
        exit(1);
     }
 
+    cloexec(sock);
+
     addr.sun_family = AF_UNIX;
     strncpy(addr.sun_path, name, sizeof(addr.sun_path));
     if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {