core-util: unify how we determine the temporary directory

This commit is contained in:
Lennart Poettering 2009-09-17 21:06:54 +02:00
parent 2d9168ceb3
commit 7b76ea3784
3 changed files with 26 additions and 20 deletions

View file

@ -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");