now blocking SIGINT and SIGTERM in restart function. the child

should handle the signal and terminate.  then the restart
function will exit.
This commit is contained in:
crs 2002-06-21 15:15:34 +00:00
parent a65bb19723
commit b83c0c5928

View File

@ -109,6 +109,13 @@ CUnixPlatform::installDaemonLogger(const char* name)
int
CUnixPlatform::restart(RestartFunc func, int minErrorCode)
{
// rely on child to catch these signals
sigset_t sigset;
sigemptyset(&sigset);
sigaddset(&sigset, SIGINT);
sigaddset(&sigset, SIGTERM);
pthread_sigmask(SIG_BLOCK, &sigset, NULL);
for (;;) {
switch (fork()) {
default: