summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common.c b/common.c
index 7880dee..90fed8a 100644
--- a/common.c
+++ b/common.c
@@ -77,8 +77,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);