1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

logind: check return value, log warning on error

This commit is contained in:
Václav Pavlín 2012-09-21 13:01:39 +02:00 committed by Lennart Poettering
parent 2f29c419b0
commit 5a165aa6b9
2 changed files with 6 additions and 2 deletions

View File

@ -526,7 +526,9 @@ static int session_create_cgroup(Session *s) {
}
}
hashmap_put(s->manager->session_cgroups, s->cgroup_path, s);
r = hashmap_put(s->manager->session_cgroups, s->cgroup_path, s);
if (r < 0)
log_warning("Failed to create mapping between cgroup and session");
return 0;
}

View File

@ -339,7 +339,9 @@ static int user_create_cgroup(User *u) {
log_warning("Failed to create cgroup %s:%s: %s", *k, p, strerror(-r));
}
hashmap_put(u->manager->user_cgroups, u->cgroup_path, u);
r = hashmap_put(u->manager->user_cgroups, u->cgroup_path, u);
if (r < 0)
log_warning("Failed to create mapping between cgroup and user");
return 0;
}