richardphibel / rpms / systemd

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