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.
This commit is contained in:
Thomas Haller 2023-03-29 07:51:26 +02:00
parent d5d6ef8f1b
commit 3694dac983

View File

@ -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 */