From 8e712ceda8462378e001d494a092fdf86b3ce340 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 29 Mar 2023 07:51:26 +0200 Subject: 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 524a1bad9..b17c87231 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 */ -- cgit v1.2.1