diff options
author | Keith Packard <keithp@keithp.com> | 2012-07-09 16:34:39 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-09 16:34:39 -0700 |
commit | 023127915e6922bc53e4c768de760d8a4f25c07c (patch) | |
tree | e1559bd6c28e90d25579629c63234e474f9c413c /os | |
parent | d6756e0298e660a0aca58d75bcf79471ce07a634 (diff) |
Reliably reset signals at server init time
Each DDX currently calls OsReleaseSIGIO in case it was suspended when
the server regen started. This causes a BUG to occur if SIGIO was
*not* blocked at that time. Instead of relying on each DDX, make the
OS layer reliably reset all signal state at server init time, ensuring
that signals are suitably unblocked and that the various signal state
counting variables are set back to zero.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os')
-rw-r--r-- | os/osinit.c | 1 | ||||
-rw-r--r-- | os/utils.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/os/osinit.c b/os/osinit.c index 6cc040178..2eb1f7a8f 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -288,6 +288,7 @@ OsInit(void) } TimerInit(); OsVendorInit(); + OsResetSignals(); /* * No log file by default. OsVendorInit() should call LogInit() with the * log file name if logging to a file is desired. diff --git a/os/utils.c b/os/utils.c index 253793467..82192e865 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1243,6 +1243,19 @@ OsReleaseSignals(void) #endif } +void +OsResetSignals(void) +{ +#ifdef SIG_BLOCK + while (BlockedSignalCount > 0) + OsReleaseSignals(); +#ifdef SIGIO + while (sigio_blocked > 0) + OsReleaseSIGIO(); +#endif +#endif +} + /* * Pending signals may interfere with core dumping. Provide a * mechanism to block signals when aborting. |