From 26d04f86a36595e3565c74d67863e076c3e3c773 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 27 Feb 2013 18:50:41 +0100 Subject: unit: rework resource management API This introduces a new static list of known attributes and their special semantics. This means that cgroup attribute values can now be automatically translated from user to kernel notation for command line set settings, too. This also adds proper support for multi-line attributes. --- src/shared/path-lookup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/shared/path-lookup.c') diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c index fa4995ceea..ffdc5367cb 100644 --- a/src/shared/path-lookup.c +++ b/src/shared/path-lookup.c @@ -41,21 +41,26 @@ DEFINE_STRING_TABLE_LOOKUP(systemd_running_as, SystemdRunningAs); int user_config_home(char **config_home) { const char *e; + char *r; e = getenv("XDG_CONFIG_HOME"); if (e) { - if (asprintf(config_home, "%s/systemd/user", e) < 0) + r = strappend(e, "/systemd/user"); + if (!r) return -ENOMEM; + *config_home = r; return 1; } else { const char *home; home = getenv("HOME"); if (home) { - if (asprintf(config_home, "%s/.config/systemd/user", home) < 0) + r = strappend(home, "/.config/systemd/user"); + if (!r) return -ENOMEM; + *config_home = r; return 1; } } -- cgit v1.2.3-54-g00ecf