diff options
-rw-r--r-- | man/sd_path_lookup.xml | 1 | ||||
-rw-r--r-- | src/libsystemd/sd-path/sd-path.c | 3 | ||||
-rw-r--r-- | src/path/path.c | 2 | ||||
-rw-r--r-- | src/systemd/sd-path.h | 5 |
4 files changed, 10 insertions, 1 deletions
diff --git a/man/sd_path_lookup.xml b/man/sd_path_lookup.xml index eda43960e7..4c1346712b 100644 --- a/man/sd_path_lookup.xml +++ b/man/sd_path_lookup.xml @@ -55,6 +55,7 @@ <constant>SD_PATH_USER_CONFIGURATION</constant>, <constant>SD_PATH_USER_RUNTIME</constant>, + <constant>SD_PATH_USER_STATE_PRIVATE</constant>, <constant>SD_PATH_USER_STATE_CACHE</constant>, <constant>SD_PATH_USER</constant>, diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c index 5207480360..36c4d89e06 100644 --- a/src/libsystemd/sd-path/sd-path.c +++ b/src/libsystemd/sd-path/sd-path.c @@ -281,6 +281,9 @@ static int get_path(uint64_t type, char **buffer, const char **ret) { case SD_PATH_USER_STATE_CACHE: return from_home_dir("XDG_CACHE_HOME", ".cache", buffer, ret); + case SD_PATH_USER_STATE_PRIVATE: + return from_home_dir("XDG_STATE_HOME", ".local/state", buffer, ret); + case SD_PATH_USER: r = get_home_dir(buffer); if (r < 0) diff --git a/src/path/path.c b/src/path/path.c index 5266240247..1daa345ebe 100644 --- a/src/path/path.c +++ b/src/path/path.c @@ -41,6 +41,8 @@ static const char* const path_table[_SD_PATH_MAX] = { [SD_PATH_USER_CONFIGURATION] = "user-configuration", [SD_PATH_USER_RUNTIME] = "user-runtime", [SD_PATH_USER_STATE_CACHE] = "user-state-cache", + [SD_PATH_USER_STATE_PRIVATE] = "user-state-private", + [SD_PATH_USER] = "user", [SD_PATH_USER_DOCUMENTS] = "user-documents", [SD_PATH_USER_MUSIC] = "user-music", diff --git a/src/systemd/sd-path.h b/src/systemd/sd-path.h index 0b61484f5e..d3ee2eff6b 100644 --- a/src/systemd/sd-path.h +++ b/src/systemd/sd-path.h @@ -53,9 +53,10 @@ enum { SD_PATH_USER_SHARED, /* User configuration, state, runtime ... */ - SD_PATH_USER_CONFIGURATION, /* takes both actual configuration (like /etc) and state (like /var/lib) */ + SD_PATH_USER_CONFIGURATION, SD_PATH_USER_RUNTIME, SD_PATH_USER_STATE_CACHE, + /* → SD_PATH_USER_STATE_PRIVATE is added at the bottom */ /* User resources */ SD_PATH_USER, /* $HOME itself */ @@ -116,6 +117,8 @@ enum { SD_PATH_SYSTEMD_SEARCH_SYSTEM_ENVIRONMENT_GENERATOR, SD_PATH_SYSTEMD_SEARCH_USER_ENVIRONMENT_GENERATOR, + SD_PATH_USER_STATE_PRIVATE, + _SD_PATH_MAX }; |