summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-07-11 14:35:47 +0000
committerMatthieu Herrb <matthieu@herrb.eu>2020-07-14 15:52:40 +0200
commit894a3a1f0bc87a924fe32bae3ff4b32656d5c5c7 (patch)
tree222926920a1028ecbb3b0e4ec6ba21f93090f5d1
parent8899e749bae5d58ed2944c97e67be4a4ca3b4811 (diff)
Restore previous SIGCHLD handler in serverPause().
This fixes the issue where xenodm whould stay stuck after kill the Xserver twice. While here add some more Debug() calls to help following what's going on
-rw-r--r--xenodm/server.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xenodm/server.c b/xenodm/server.c
index a7b548f..f247a1d 100644
--- a/xenodm/server.c
+++ b/xenodm/server.c
@@ -157,8 +157,10 @@ serverPause (unsigned t, pid_t serverPid)
struct timespec timeout;
sigset_t mask;
int result;
- pid_t pid;
+ pid_t pid;
+ void (*old)(int);
+ Debug("serverPause\n");
serverPauseRet = false;
for (;;) {
@@ -166,7 +168,7 @@ serverPause (unsigned t, pid_t serverPid)
timeout.tv_nsec = 0;
/* setup a SIGCHLD handler, to interrupt ppoll() below */
- signal(SIGCHLD, chldHandler);
+ old = signal(SIGCHLD, chldHandler);
/* unblock all signals*/
sigemptyset(&mask);
if (!receivedUsr1) {
@@ -189,7 +191,7 @@ serverPause (unsigned t, pid_t serverPid)
break;
}
}
- signal(SIGCHLD, SIG_DFL);
+ signal(SIGCHLD, old);
if (serverPauseRet) {
Debug ("Server died\n");
LogError ("server unexpectedly died\n");
@@ -235,6 +237,7 @@ WaitForServer (struct display *d)
void
ResetServer (struct display *d)
{
+ Debug("ResetServer");
if (d->dpy)
pseudoReset (d->dpy);
}