diff --git a/src/utils2.c b/src/utils2.c index 3bacf8fae..d424e0e22 100644 --- a/src/utils2.c +++ b/src/utils2.c @@ -3308,7 +3308,14 @@ size_t pathlen; dir = pathJoin(result, subdir); } #else - dir = pathJoin("/tmp", subdir); + { + char *tmpDir = getenv("TMPDIR"); + if (tmpDir == NULL) { + tmpDir = "/tmp"; + } + dir = pathJoin(tmpDir, subdir); + } + #endif /* ~ OS_IOS */ #ifndef _WIN32