summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-17 21:06:54 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-17 21:06:54 +0200
commit7b76ea378460bf3e037dff90742f88f74ee70b11 (patch)
treee697a297de5f3f4ad379fa8483b83946da142ee2 /src/utils
parent2d9168ceb388cbb6dba49cc3a531921f78ec3295 (diff)
core-util: unify how we determine the temporary directory
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/padsp.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index c8c0874d..2ed0a039 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -1398,17 +1398,8 @@ static int sndstat_open(int flags, int *_errno) {
mode_t u;
int fd = -1;
int e;
- const char *tmpdir;
- if (!(tmpdir = getenv("TMPDIR")))
- if (!(tmpdir = getenv("TMP")))
- if (!(tmpdir = getenv("TEMP")))
- tmpdir = getenv("TEMPDIR");
-
- if (!tmpdir || !pa_is_path_absolute(tmpdir))
- tmpdir = "/tmp";
-
- fn = pa_sprintf_malloc("%s" PA_PATH_SEP "padsp-sndstat-XXXXXX", tmpdir);
+ fn = pa_sprintf_malloc("%s" PA_PATH_SEP "padsp-sndstat-XXXXXX", pa_get_temp_dir());
debug(DEBUG_LEVEL_NORMAL, __FILE__": sndstat_open()\n");