ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
592caf
From 188465c472996b426a1f22a9fc46d031b722c3b4 Mon Sep 17 00:00:00 2001
592caf
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
592caf
Date: Tue, 10 Nov 2020 12:57:34 +0100
592caf
Subject: [PATCH] sd-event: increase n_enabled_child_sources just once
592caf
592caf
Neither source_child_pidfd_register() nor event_make_signal_data() look at
592caf
n_enabled_child_sources.
592caf
592caf
(cherry picked from commit ac9f2640cb9c107b43f47bba7e068d3b92b5337b)
592caf
592caf
Related: #1819868
592caf
---
592caf
 src/libsystemd/sd-event/sd-event.c | 3 +--
592caf
 1 file changed, 1 insertion(+), 2 deletions(-)
592caf
592caf
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
592caf
index 0cfba8fb39..d18ce28a92 100644
592caf
--- a/src/libsystemd/sd-event/sd-event.c
592caf
+++ b/src/libsystemd/sd-event/sd-event.c
592caf
@@ -2383,8 +2383,6 @@ static int event_source_enable(sd_event_source *s, int enable) {
592caf
                 break;
592caf
 
592caf
         case SOURCE_CHILD:
592caf
-                s->event->n_enabled_child_sources++;
592caf
-
592caf
                 r = event_make_signal_data(s->event, SIGCHLD, NULL);
592caf
                 if (r < 0) {
592caf
                         s->enabled = SD_EVENT_OFF;
592caf
@@ -2393,6 +2391,7 @@ static int event_source_enable(sd_event_source *s, int enable) {
592caf
                         return r;
592caf
                 }
592caf
 
592caf
+                s->event->n_enabled_child_sources++;
592caf
 
592caf
                 break;
592caf