chiark / gitweb /
sd-event: fix sd_event_source_get_priority() (#4712)
[elogind.git] / src / libelogind / sd-event / sd-event.c
index cfd5a55..383de48 100644 (file)
@@ -732,6 +732,7 @@ static void event_unmask_signal_data(sd_event *e, struct signal_data *d, int sig
 
                 /* If all the mask is all-zero we can get rid of the structure */
                 hashmap_remove(e->signal_data, &d->priority);
+                assert(!d->current);
                 safe_close(d->fd);
                 free(d);
                 return;
@@ -1551,7 +1552,8 @@ _public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *priority)
         assert_return(s, -EINVAL);
         assert_return(!event_pid_changed(s->event), -ECHILD);
 
-        return s->priority;
+        *priority = s->priority;
+        return 0;
 }
 #endif // 0