dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit ff6cfa55b885b82538098042dcccc1de117b4281
parent ccd9cadf4bbc634a0db900e277a1ac2d8e9aa585
Author: Ross Mohn <rpmohn@waxandwane.org>
Date:   Sat, 27 Nov 2010 11:57:45 +0100

Move signal re-registration to the end of the signal handler

This fixes a subtle timing issue on AIX which resulted in a coredump.
The signal handler was being re-registered before the original signal
was actually handled, throwing the handler into an infinite loop.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
dvtm.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -760,8 +760,6 @@ sigchld_handler(int sig) { pid_t pid; Client *c; - signal(SIGCHLD, sigchld_handler); - while ((pid = waitpid(-1, &status, WNOHANG)) != 0) { if (pid == -1) { if (errno == ECHILD) { @@ -776,6 +774,8 @@ sigchld_handler(int sig) { c->died = true; } + signal(SIGCHLD, sigchld_handler); + errno = errsv; }