chiark / gitweb /
logind: log which process is delaying suspend and not closing locks
[elogind.git] / src / login / logind-inhibit.c
index 3bc4642071dc09745f8560b7206c6634479bc88b..35e1abd72918fcea2d8893829ecc57f17efc3d0f 100644 (file)
@@ -22,7 +22,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <string.h>
-#include <errno.h>
 #include <unistd.h>
 
 #include "util.h"
@@ -305,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;
         }
@@ -373,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;
@@ -401,6 +401,9 @@ bool manager_is_inhibited(
                         ts = i->since;
 
                 inhibited = true;
+
+                if (offending)
+                        *offending = i;
         }
 
         if (since)