From ed77188bfdf44b1aa8dc8af05e12bc38aecd4041 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sun, 13 Mar 2016 01:02:07 +0100 Subject: Use TMPDIR as a fallback if set --- json-rpc-shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/json-rpc-shell.c b/json-rpc-shell.c index 0830aae..fb95ee7 100644 --- a/json-rpc-shell.c +++ b/json-rpc-shell.c @@ -3059,8 +3059,11 @@ resolve_relative_runtime_unique_filename (const char *filename) str_init (&path); const char *runtime_dir = getenv ("XDG_RUNTIME_DIR"); + const char *tmpdir = getenv ("TMPDIR"); if (runtime_dir && *runtime_dir == '/') str_append (&path, runtime_dir); + else if (tmpdir && *tmpdir == '/') + str_append (&path, tmpdir); else str_append (&path, "/tmp"); str_append_printf (&path, "/%s/%s", PROGRAM_NAME, filename); -- cgit v1.2.3-70-g09d2