diff options
author | Thomas Haller <thaller@redhat.com> | 2023-03-29 07:51:26 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-05-17 16:30:24 +0200 |
commit | 8e712ceda8462378e001d494a092fdf86b3ce340 (patch) | |
tree | 3986d5c8aedcd63f2e1d63d8342d8e20e8ee1b19 | |
parent | 8b3211b70b544d0f2048ef59e1d8070e9ab38f79 (diff) | |
download | glib-th/child-watch-waitpid.tar.gz |
gmain: ensure boolean value in g_child_watch_check() is strictly 0 or 1th/child-watch-waitpid
No problem in practice, but it seems nice to ensure that a gboolean is
always either FALSE or TRUE.
-rw-r--r-- | glib/gmain.c | 4 |
1 files 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 */ |