chiark / gitweb /
logind: check return value, log warning on error
authorVáclav Pavlín <vpavlin@redhat.com>
Fri, 21 Sep 2012 11:01:39 +0000 (13:01 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Sep 2012 14:04:48 +0000 (16:04 +0200)
src/login/logind-session.c
src/login/logind-user.c

index f670db8..958b516 100644 (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;
 }
index 9dfead9..b692b53 100644 (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;
 }