From 3a14718bb76a9fb8e730c4423562b34ab6d9da81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 7 Mar 2014 18:41:34 +0100 Subject: [PATCH] Respect $TMPDIR when creating sockets --- abduco.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/abduco.c b/abduco.c index 3237059..9407a2c 100644 --- a/abduco.c +++ b/abduco.c @@ -184,6 +184,8 @@ static void usage() { static int create_socket_dir() { size_t maxlen = sizeof(sockaddr.sun_path); char *dir = getenv("HOME"); + if (!dir) + dir = getenv("TMPDIR"); if (!dir) dir = "/tmp"; int len = snprintf(sockaddr.sun_path, maxlen, "%s/.%s/", dir, server.name);