This makes this function name similar to user_config_home() and makes
it match the name of the environment variable.
if (mode == UNIT_PERSISTENT && !transient)
r = user_config_home(dir);
else
if (mode == UNIT_PERSISTENT && !transient)
r = user_config_home(dir);
else
+ r = user_runtime_dir(dir);
if (r == 0)
return -ENOENT;
if (r == 0)
return -ENOENT;
if (u->manager->running_as == SYSTEMD_USER) {
_cleanup_free_ char *c = NULL;
if (u->manager->running_as == SYSTEMD_USER) {
_cleanup_free_ char *c = NULL;
+ r = user_runtime_dir(&c);
if (r < 0)
return r;
if (r == 0)
if (r < 0)
return r;
if (r == 0)
return -EINVAL;
if (runtime)
return -EINVAL;
if (runtime)
+ r = user_runtime_dir(&p);
else
r = user_config_home(&p);
else
r = user_config_home(&p);
-int user_runtime(char **user_runtime_path) {
+int user_runtime_dir(char **runtime_dir) {
- *user_runtime_path = r;
- _cleanup_free_ char *config_home = NULL, *user_runtime_dir = NULL, *data_home = NULL;
+ _cleanup_free_ char *config_home = NULL, *runtime_dir = NULL, *data_home = NULL;
_cleanup_strv_free_ char **config_dirs = NULL, **data_dirs = NULL;
char **r = NULL;
_cleanup_strv_free_ char **config_dirs = NULL, **data_dirs = NULL;
char **r = NULL;
if (user_config_home(&config_home) < 0)
goto fail;
if (user_config_home(&config_home) < 0)
goto fail;
- if (user_runtime(&user_runtime_dir) < 0)
+ if (user_runtime_dir(&runtime_dir) < 0)
goto fail;
home = getenv("HOME");
goto fail;
home = getenv("HOME");
if (strv_extend(&r, config_home) < 0)
goto fail;
if (strv_extend(&r, config_home) < 0)
goto fail;
- if (user_runtime_dir)
- if (strv_extend(&r, user_runtime_dir) < 0)
+ if (runtime_dir)
+ if (strv_extend(&r, runtime_dir) < 0)
goto fail;
if (strv_extend(&r, runtime_unit_path) < 0)
goto fail;
if (strv_extend(&r, runtime_unit_path) < 0)
} SystemdRunningAs;
int user_config_home(char **config_home);
} SystemdRunningAs;
int user_config_home(char **config_home);
-int user_runtime(char **user_runtime_path);
+int user_runtime_dir(char **runtime_dir);
int lookup_paths_init(LookupPaths *p,
SystemdRunningAs running_as,
int lookup_paths_init(LookupPaths *p,
SystemdRunningAs running_as,