From: Lennart Poettering Date: Thu, 20 Jul 2017 12:19:57 +0000 (+0200) Subject: sd-path: make sure to use tmp_dir() and var_tmp_dir() (#6397) X-Git-Tag: v235~312 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fccb44863b6084dcb323ee1d97682a142e785d50;p=thirdparty%2Fsystemd.git sd-path: make sure to use tmp_dir() and var_tmp_dir() (#6397) Let's reuse the common code wherever appropriate. --- diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c index 752c1ba56bb..6e41dac1ade 100644 --- a/src/libsystemd/sd-path/sd-path.c +++ b/src/libsystemd/sd-path/sd-path.c @@ -23,6 +23,7 @@ #include "architecture.h" #include "fd-util.h" #include "fileio.h" +#include "fs-util.h" #include "missing.h" #include "path-util.h" #include "string-util.h" @@ -219,10 +220,10 @@ static int get_path(uint64_t type, char **buffer, const char **ret) { switch (type) { case SD_PATH_TEMPORARY: - return from_environment("TMPDIR", "/tmp", ret); + return tmp_dir(ret); case SD_PATH_TEMPORARY_LARGE: - return from_environment("TMPDIR", "/var/tmp", ret); + return var_tmp_dir(ret); case SD_PATH_SYSTEM_BINARIES: *ret = "/usr/bin";