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
1 changed files with 7 additions and 0 deletions

View File

@ -109,6 +109,13 @@ CUnixPlatform::installDaemonLogger(const char* name)
int int
CUnixPlatform::restart(RestartFunc func, int minErrorCode) 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 (;;) { for (;;) {
switch (fork()) { switch (fork()) {
default: default: