Changed signal handlers

This commit is contained in:
Michiel Broek 2004-11-30 20:07:19 +00:00
parent 7d64e500af
commit 174ad91d2a
3 changed files with 11 additions and 13 deletions

View File

@ -124,6 +124,12 @@ Syslog('b', "Will hangup");
hangup(); hangup();
Syslog('b', "Done"); Syslog('b', "Done");
for (i = 0; i < NSIG; i++) {
if ((i == SIGHUP) || (i == SIGPIPE) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
signal(i, SIG_DFL);
}
Syslog('b', "Restored signals");
if (do_mailout) if (do_mailout)
CreateSema((char *)"mailout"); CreateSema((char *)"mailout");
@ -169,6 +175,7 @@ void Quick_Bye(int onsig)
* Prevent that we call die() if something goes wrong next * Prevent that we call die() if something goes wrong next
*/ */
for (i = 0; i < NSIG; i++) for (i = 0; i < NSIG; i++)
if ((i == SIGHUP) || (i == SIGPIPE) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
signal(i, SIG_DFL); signal(i, SIG_DFL);
colour(LIGHTGRAY, BLACK); colour(LIGHTGRAY, BLACK);

View File

@ -78,12 +78,6 @@ int main(int argc, char **argv)
Quick_Bye(MBERR_OK); Quick_Bye(MBERR_OK);
} }
/*
* Set the users device to writable by other bbs users, so they
* can send one-line messages
*/
// chmod(tty, 00666);
/* /*
* Get MBSE_ROOT Path and load Config into Memory * Get MBSE_ROOT Path and load Config into Memory
*/ */
@ -114,8 +108,7 @@ int main(int argc, char **argv)
} }
PUTSTR((char *)"Loading MBSE BBS ..."); PUTSTR((char *)"Loading MBSE BBS ...");
PUTCHAR('\r'); Enter(1);
PUTCHAR('\n');
if ((p = getenv("CONNECT")) != NULL) if ((p = getenv("CONNECT")) != NULL)
Syslog('+', "CONNECT %s", p); Syslog('+', "CONNECT %s", p);
@ -156,8 +149,6 @@ int main(int argc, char **argv)
signal(i, (void (*))die); signal(i, (void (*))die);
else if (i == SIGCHLD) else if (i == SIGCHLD)
signal(i, SIG_DFL); signal(i, SIG_DFL);
else if ((i != SIGKILL) && (i != SIGSTOP))
signal(i, SIG_IGN);
} }
/* /*

View File

@ -48,7 +48,7 @@ extern int hanged_up; /* Hanged up status */
void die(int onsig) void die(int onsig)
{ {
if (onsig <= NSIG) if (onsig <= NSIG)
signal(onsig, SIG_IGN); signal(onsig, SIG_DFL);
/* /*
* First check if there is a child running, if so, kill it. * First check if there is a child running, if so, kill it.