#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
-#include "formats-util.h"
+#include "format-util.h"
#include "logind-inhibit.h"
#include "mkdir.h"
#include "parse-util.h"
if (r < 0)
return r;
- i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref", NULL);
+ i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref");
if (!i->fifo_path)
return -ENOMEM;
assert(m);
HASHMAP_FOREACH(i, m->inhibitors, j)
- if (i->mode == mm)
+ if (i->mode == mm && i->started)
what |= i->what;
return what;
assert(w > 0 && w < _INHIBIT_WHAT_MAX);
HASHMAP_FOREACH(i, m->inhibitors, j) {
+ if (!i->started)
+ continue;
+
if (!(i->what & w))
continue;