mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
sd-path: make sure to use tmp_dir() and var_tmp_dir() (#6397)
Let's reuse the common code wherever appropriate.
This commit is contained in:
committed by
Martin Pitt
parent
708d423915
commit
fccb44863b
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user