abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 3a14718bb76a9fb8e730c4423562b34ab6d9da81
parent 4fdb48dfcd245e4d6f5a78f7debbc4674cca31b5
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri,  7 Mar 2014 18:41:34 +0100

Respect $TMPDIR when creating sockets

Diffstat:
abduco.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/abduco.c b/abduco.c @@ -185,6 +185,8 @@ 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); if (len < 0 || (size_t)len >= maxlen)