]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: assert on hashmap_remove(child.pid)
authorMike Yuan <me@yhndnzj.com>
Fri, 21 Feb 2025 15:45:34 +0000 (16:45 +0100)
committerMike Yuan <me@yhndnzj.com>
Fri, 21 Feb 2025 17:08:02 +0000 (18:08 +0100)
Follow-up for 54988a27b9d1487e1690f94b79031ef61edd6651
and a342c71d360e083b3f6b06a64d852c4e3aceeef3

src/libsystemd/sd-event/sd-event.c

index f2abbb1b51603ced7a214dc68d9617991949bbb5..1fea7d5aa7897fb7c438e461e2a6bc5c0270f286 100644 (file)
@@ -988,7 +988,7 @@ static void source_disconnect(sd_event_source *s) {
                                 s->event->n_online_child_sources--;
                         }
 
-                        (void) hashmap_remove(s->event->child_sources, PID_TO_PTR(s->child.pid));
+                        assert_se(hashmap_remove(s->event->child_sources, PID_TO_PTR(s->child.pid)));
                 }
 
                 if (EVENT_SOURCE_WATCH_PIDFD(s))