chiark / gitweb /
exec: add ControlGroupModify= switch to allow changing access mode to cgroups fs
[elogind.git] / src / load-fragment.c
index 56eaed9ab4de06e7e73701f91608ee513cead51e..0c2ef916522350a70b82c1c0291a6b85e5aba0a2 100644 (file)
@@ -1661,13 +1661,16 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
                  * unit name. */
                 name = file_name_from_path(*filename);
 
-                if (unit_name_is_valid(name, false)) {
-                        if (!(id = set_get(names, name))) {
+                if (unit_name_is_valid(name, true)) {
 
-                                if (!(id = strdup(name)))
+                        id = set_get(names, name);
+                        if (!id) {
+                                id = strdup(name);
+                                if (!id)
                                         return -ENOMEM;
 
-                                if ((r = set_put(names, id)) < 0) {
+                                r = set_put(names, id);
+                                if (r < 0) {
                                         free(id);
                                         return r;
                                 }
@@ -1908,7 +1911,8 @@ static int load_from_path(Unit *u, const char *path) {
                 { "KillMode",               config_parse_kill_mode,       0, &(context).kill_mode,                            section   }, \
                 { "KillSignal",             config_parse_kill_signal,     0, &(context).kill_signal,                          section   }, \
                 { "SendSIGKILL",            config_parse_bool,            0, &(context).send_sigkill,                         section   }, \
-                { "UtmpIdentifier",         config_parse_string_printf,   0, &(context).utmp_id,                              section   }
+                { "UtmpIdentifier",         config_parse_string_printf,   0, &(context).utmp_id,                              section   }, \
+                { "ControlGroupModify",     config_parse_bool,            0, &(context).control_group_modify,                 section   }
 
         const ConfigItem items[] = {
                 { "Names",                  config_parse_names,           0, u,                                               "Unit"    },