xwayland: don't fail on SIGCHLD

SIGCHLD here isn't fatal: we have other means of notifying that things were
successful or failure, and it causes many compositors to have to do a bunch
of extra work:

https://github.com/qtile/qtile/issues/5101
https://github.com/flacjacket/pywlroots/pull/207#issuecomment-2502680133
https://github.com/djpohly/dwl/pull/212

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
This commit is contained in:
Tycho Andersen 2024-11-27 08:16:16 -07:00 committed by Simon Ser
parent be3d2b74cf
commit 631e5be0d7

View file

@ -257,6 +257,17 @@ static int xserver_handle_ready(int fd, uint32_t mask, void *data) {
if (errno == EINTR) {
continue;
}
/* If some application has installed a SIGCHLD handler, they
* may race and waitpid() on our child, which will cause this
* waitpid() to fail. We have a signal from the
* notify pipe that things are ready, so this waitpid() is only
* to prevent zombies, which will have already been reaped by
* the application's SIGCHLD handler.
*/
if (errno == ECHILD) {
break;
}
wlr_log_errno(WLR_ERROR, "waitpid for Xwayland fork failed");
goto error;
}