From: Bruno Prémont Subject: weston-launch: Fix tight poll/recvmsg loop on weston exit When weston fails to run while being launched by weston-launch it's socketpair causes poll() to notify POLLIN|POLLHUP and lets recvmsg() return 0. Properly cleanup and exit in that case instead of poll()ing in a tight loop and leaving tty in graphics mode if we get SIGKILLed as only way out. This happens only when weston-launch (and weston) are being traced as in `strace -f weston-launch` as then signalfd is not passing the SIGCHLD signal. --- --- a/src/weston-launch.c 2015-03-01 18:46:27.289835438 +0100 +++ b/src/weston-launch.c 2015-03-01 18:46:24.599835453 +0100 @@ -771,6 +771,8 @@ main(int argc, char *argv[]) error(0, errno, "poll failed"); if (fds[0].revents & POLLIN) handle_socket_msg(&wl); + if (fds[0].revents & POLLHUP) + quit(&wl, 0); if (fds[1].revents) handle_signal(&wl); }