if (streq_ptr(udev_device_get_action(d), "remove")) {
- /* FIXME: use syspath instead of sysname here, as soon as fb driver is fixed */
- device = hashmap_get(m->devices, udev_device_get_sysname(d));
+ device = hashmap_get(m->devices, udev_device_get_syspath(d));
if (!device)
return 0;
return 0;
}
- r = manager_add_device(m, udev_device_get_sysname(d), &device);
+ r = manager_add_device(m, udev_device_get_syspath(d), &device);
if (r < 0)
return r;
int r = 0;
char *name;
DIR *d;
+ int k;
r = cg_enumerate_subgroups(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_path, &d);
if (r < 0) {
return r;
}
- while ((r = cg_read_subgroup(d, &name)) > 0) {
+ while ((k = cg_read_subgroup(d, &name)) > 0) {
User *user;
- int k;
k = manager_add_user_by_name(m, name, &user);
if (k < 0) {
free(name);
}
+ if (r >= 0 && k < 0)
+ r = k;
+
closedir(d);
return r;
}
static int manager_parse_config_file(Manager *m) {
-
- const ConfigItem items[] = {
- { "NAutoVTs", config_parse_unsigned, 0, &m->n_autovts, "Login" },
- { "KillUserProcesses", config_parse_bool, 0, &m->kill_user_processes, "Login" },
- { "KillOnlyUsers", config_parse_strv, 0, &m->kill_only_users, "Login" },
- { "KillExcludeUsers", config_parse_strv, 0, &m->kill_exclude_users, "Login" },
- { "Controllers", config_parse_strv, 0, &m->controllers, "Login" },
- { "ResetControllers", config_parse_strv, 0, &m->reset_controllers, "Login" },
- { NULL, NULL, 0, NULL, NULL }
- };
-
- static const char * const sections[] = {
- "Login",
- NULL
- };
-
FILE *f;
const char *fn;
int r;
return -errno;
}
- r = config_parse(fn, f, sections, items, false, NULL);
+ r = config_parse(fn, f, "Login\0", config_item_perf_lookup, (void*) logind_gperf_lookup, false, m);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc != 1) {
log_error("This program takes no arguments.");
r = -EINVAL;
goto finish;
}
- umask(0022);
-
m = manager_new();
if (!m) {
log_error("Out of memory");