diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2018-07-11 16:57:05 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@herrb.eu> | 2020-07-14 15:52:41 +0200 |
commit | b7a5b9e79ce306e020bb7083a04ca5d327cf7920 (patch) | |
tree | 8efc2b0488310c7e891302a9b6eb0c10a84da7fb /xenodm | |
parent | e4b3b08d8520adba696456f904b30a6e54e9b6d2 (diff) |
Keep a better trace of pending children to be reaped.
Diffstat (limited to 'xenodm')
-rw-r--r-- | xenodm/dm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xenodm/dm.c b/xenodm/dm.c index 8700592..77920b5 100644 --- a/xenodm/dm.c +++ b/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 */ |