summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-07-11 16:57:05 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-07-11 16:57:05 +0000
commit83d7cf0b7ffb0ac0554f0a9496e571d42d4f1062 (patch)
tree9d22f5881a9e4bbc56bedaf01f07ff6cc2e9ce4b
parentce1392a3d806d2fc97261afb0e3d4c3d97103902 (diff)
Keep a better trace of pending children to be reaped.
-rw-r--r--app/xenodm/xenodm/dm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/xenodm/xenodm/dm.c b/app/xenodm/xenodm/dm.c
index 87005923d..77920b5cf 100644
--- a/app/xenodm/xenodm/dm.c
+++ b/app/xenodm/xenodm/dm.c
@@ -57,7 +57,7 @@ static void ScanServers (void);
static void SetConfigFileTime (void);
static void StartDisplays (void);
-volatile int Rescan;
+static volatile int Rescan = 0;
static long ServersModTime, ConfigModTime;
int nofork_session = 0;
@@ -279,7 +279,7 @@ StopAll (int n)
* sub-daemon started
*/
-int ChildReady;
+static volatile int ChildReady = 0;
/* ARGSUSED */
static void
@@ -287,7 +287,7 @@ ChildNotify (int n)
{
int olderrno = errno;
- ChildReady = 1;
+ ChildReady++;
errno = olderrno;
}
@@ -306,12 +306,12 @@ WaitForChild (void)
Debug ("signals blocked\n");
if (!ChildReady && !Rescan)
sigsuspend(&omask);
- ChildReady = 0;
sigprocmask(SIG_SETMASK, &omask, (sigset_t *)NULL);
while ((pid = waitpid (-1, &status, WNOHANG)) > 0)
{
Debug ("Manager wait returns pid: %d sig %d core %d code %d\n",
pid, waitSig(status), waitCore(status), waitCode(status));
+ ChildReady--;
if (autoRescan)
RescanIfMod ();
/* SUPPRESS 560 */