From 3694dac9832f6839500b9c4b48611432ac83eb9b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 29 Mar 2023 07:51:26 +0200 Subject: [PATCH] gmain: ensure boolean value in g_child_watch_check() is strictly 0 or 1 No problem in practice, but it seems nice to ensure that a gboolean is always either FALSE or TRUE. --- glib/gmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glib/gmain.c b/glib/gmain.c index 7272d8485..1a753753c 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -5531,12 +5531,12 @@ g_child_watch_check (GSource *source) child_watch_source = (GChildWatchSource *) source; #ifdef G_OS_WIN32 - child_exited = child_watch_source->poll.revents & G_IO_IN; + child_exited = !!(child_watch_source->poll.revents & G_IO_IN); #else /* G_OS_WIN32 */ #ifdef HAVE_PIDFD if (child_watch_source->poll.fd >= 0) { - child_exited = child_watch_source->poll.revents & G_IO_IN; + child_exited = !!(child_watch_source->poll.revents & G_IO_IN); return child_exited; } #endif /* HAVE_PIDFD */