mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 21:03:10 +02:00
gmain: simplify handling child watchers in dispatch_unix_signals_unlocked()
- if a child watch source has "using_pidfd", it is never linked in the unix_child_watches list. Drop that check. - replace the deep nested if, with an early "continue" in the loop, if we detect there is nothing to do. It makes the code easier to read.
This commit is contained in:
parent
9315a211fa
commit
a71b0c0461
@ -5695,11 +5695,11 @@ dispatch_unix_signals_unlocked (void)
|
||||
for (node = unix_child_watches; node; node = node->next)
|
||||
{
|
||||
GChildWatchSource *source = node->data;
|
||||
|
||||
if (!source->using_pidfd &&
|
||||
!g_atomic_int_get (&source->child_exited))
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
if (g_atomic_int_get (&source->child_exited))
|
||||
continue;
|
||||
|
||||
do
|
||||
{
|
||||
g_assert (source->pid > 0);
|
||||
@ -5721,7 +5721,6 @@ dispatch_unix_signals_unlocked (void)
|
||||
while (pid == -1 && errno == EINTR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* handle GUnixSignalWatchSource instances */
|
||||
for (node = unix_signal_watches; node; node = node->next)
|
||||
|
Loading…
x
Reference in New Issue
Block a user