chiark / gitweb /
logind: log which process is delaying suspend and not closing locks
[elogind.git] / src / login / logind-inhibit.c
index 26cce8d7fcdd3defe57729421a6aa7de340a78e3..35e1abd72918fcea2d8893829ecc57f17efc3d0f 100644 (file)
@@ -304,7 +304,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
                 if (r < 0)
                         return r;
 
-                r = sd_event_source_set_priority(i->event_source, SD_PRIORITY_IDLE);
+                r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE);
                 if (r < 0)
                         return r;
         }
@@ -372,7 +372,8 @@ bool manager_is_inhibited(
                 dual_timestamp *since,
                 bool ignore_inactive,
                 bool ignore_uid,
-                uid_t uid) {
+                uid_t uid,
+                Inhibitor **offending) {
 
         Inhibitor *i;
         Iterator j;
@@ -400,6 +401,9 @@ bool manager_is_inhibited(
                         ts = i->since;
 
                 inhibited = true;
+
+                if (offending)
+                        *offending = i;
         }
 
         if (since)