diff options
author | Umut Tezduyar <umut@tezduyar.com> | 2013-06-09 07:08:46 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-06-20 16:27:45 -0400 |
commit | 97d0e5f83ba4dd713170f802b90149b7325bc992 (patch) | |
tree | 21bd3c2a72f7d2c352513f1ceaf6ca0505889a4c /src/core/manager.c | |
parent | 8c1396b1c2dfecbb59af61064f6a0f624385004d (diff) |
manager: add DefaultEnvironment option
This complements existing functionality of setting variables
through 'systemctl set-environment', the kernel command line,
and through normal environment variables for systemd in session
mode.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index f16621ac2b..5c3a2c72f3 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2570,6 +2570,18 @@ void manager_undo_generators(Manager *m) { remove_generator_dir(m, &m->generator_unit_path_late); } +int manager_set_default_environment(Manager *m, char **environment) { + + char **e = NULL; + assert(m); + e = strv_env_merge(2, m->environment, environment); + if (!e) + return -ENOMEM; + strv_free(m->environment); + m->environment = e; + return 0; +} + int manager_set_default_controllers(Manager *m, char **controllers) { char **l; |