From 0ea1ec1ed445235cdba9e54e71023d5a82feed6b Mon Sep 17 00:00:00 2001 From: Arthur Williams Date: Fri, 14 Oct 2022 20:59:54 -0700 Subject: Don't wait for X to finish starting if it has died On my setup, when X first starts there aren't any screens available so it immediately dies. Half a second later, screens become available but xinit would still be waiting for the dead X process to signal that it is ready. It'll take 15s for it to timeout and respawn X. This patch makes xinit listen for its child's death and if X dies, it'll immediately stop waiting for it to finish starting and attempt to start it again. --- xinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xinit.c b/xinit.c index 06c92b2..19022c1 100644 --- a/xinit.c +++ b/xinit.c @@ -263,7 +263,6 @@ main(int argc, char *argv[]) /* * Start the server and client. */ - signal(SIGCHLD, SIG_DFL); /* Insurance */ /* Let those signal interrupt the wait() call in the main loop */ memset(&sa, 0, sizeof sa); @@ -284,6 +283,7 @@ main(int argc, char *argv[]) sigaction(SIGALRM, &si, NULL); sigaction(SIGUSR1, &si, NULL); + sigaction(SIGCHLD, &si, NULL); #ifdef __APPLE__ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 -- cgit v1.2.1