summaryrefslogtreecommitdiff
path: root/xinit.c
diff options
context:
space:
mode:
authorArthur Williams <taaparthur@disroot.org>2022-10-14 20:59:54 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-16 19:49:43 +0000
commit0ea1ec1ed445235cdba9e54e71023d5a82feed6b (patch)
treedf6349013225f20c968cd18a02a3bbd873eb839b /xinit.c
parent60389ce90f552d9dfef8facf0efaf48efa59d93c (diff)
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.
Diffstat (limited to 'xinit.c')
-rw-r--r--xinit.c2
1 files changed, 1 insertions, 1 deletions
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