X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxagentc.c;h=9f579cd9488bda6efc085b30b4d6dcc65c413e12;hb=3e22c99c9a3c28e042f2dc3a50fadf95e7c277e7;hp=7b737d1d5ab7c4ecd592109ba86a92fe3c2a1cfb;hpb=fd6d9bd677cbb2a1a56060d118f4d56b61c82244;p=PuTTY.git diff --git a/unix/uxagentc.c b/unix/uxagentc.c index 7b737d1d..9f579cd9 100644 --- a/unix/uxagentc.c +++ b/unix/uxagentc.c @@ -17,7 +17,8 @@ int agent_exists(void) { - if (getenv("SSH_AUTH_SOCK") != NULL) + const char *p = getenv("SSH_AUTH_SOCK"); + if (p && *p) return TRUE; return FALSE; } @@ -122,7 +123,7 @@ int agent_query(void *in, int inlen, void **out, int *outlen, exit(1); } - fcntl(sock, F_SETFD, FD_CLOEXEC); + cloexec(sock); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, name, sizeof(addr.sun_path));