diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-06-27 21:50:35 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-06-27 21:50:35 +0200 |
commit | b42defe3b8ed3947d85db654a6cdb1b9999f394d (patch) | |
tree | c5ff15f05ca1a314cb76ce144f2da79b80cac9d6 /src/core/unit.c | |
parent | 8e2af478402414f060bbc16e1b4bbe7de1779c13 (diff) |
dbus: make more cgroup attributes runtime settable
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index be554dac20..211704e230 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2691,6 +2691,8 @@ int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, co int r; assert(u); + assert(name); + assert(data); if (!(mode & (UNIT_PERSISTENT|UNIT_RUNTIME))) return 0; @@ -2703,6 +2705,23 @@ int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, co return write_string_file_atomic_label(q, data); } +int unit_write_drop_in_private_section(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data) { + _cleanup_free_ char *ndata = NULL; + + assert(u); + assert(name); + assert(data); + + if (!UNIT_VTABLE(u)->private_section) + return -EINVAL; + + ndata = strjoin("[", UNIT_VTABLE(u)->private_section, "]\n", data, NULL); + if (!ndata) + return -ENOMEM; + + return unit_write_drop_in(u, mode, name, ndata); +} + int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name) { _cleanup_free_ char *p = NULL, *q = NULL; int r; |