chiark / gitweb /
login: missing break for getopt ARG_NO_ASK_PASSWORD in loginctl
[elogind.git] / src / login / logind-session.c
index 9740e23a1670f2556455ced06148dddc3de5e8fc..958b516701a9d95ea0890146ab0bc7e4aced8336 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;
 }
@@ -738,7 +740,6 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) {
         char *p;
         struct stat st;
         usec_t u, n;
-        bool b;
         int k;
 
         assert(s);
@@ -773,12 +774,11 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) {
 
         u = timespec_load(&st.st_atim);
         n = now(CLOCK_REALTIME);
-        b = u + IDLE_THRESHOLD_USEC < n;
 
         if (t)
-                dual_timestamp_from_realtime(t, u + b*IDLE_THRESHOLD_USEC);
+                dual_timestamp_from_realtime(t, u);
 
-        return b;
+        return u + IDLE_THRESHOLD_USEC < n;
 
 dont_know:
         if (t)