i = hashmap_get(m->inhibitors, id);
if (!i) {
- r = inhibitor_new(&i, m, id);
+ r = inhibitor_new(m, id, &i);
if (r < 0)
return r;
}
static void inhibitor_remove_fifo(Inhibitor *i);
-int inhibitor_new(Inhibitor **ret, Manager *m, const char* id) {
+int inhibitor_new(Manager *m, const char* id, Inhibitor **ret) {
_cleanup_(inhibitor_freep) Inhibitor *i = NULL;
int r;
- assert(ret);
assert(m);
assert(id);
+ assert(ret);
i = new(Inhibitor, 1);
if (!i)
int fifo_fd;
};
-int inhibitor_new(Inhibitor **ret, Manager *m, const char* id);
+int inhibitor_new(Manager *m, const char* id, Inhibitor **ret);
Inhibitor* inhibitor_free(Inhibitor *i);
DEFINE_TRIVIAL_CLEANUP_FUNC(Inhibitor*, inhibitor_free);