Changed signal handlers
This commit is contained in:
parent
7d64e500af
commit
174ad91d2a
@ -121,9 +121,15 @@ void Good_Bye(int onsig)
|
||||
cookedport();
|
||||
}
|
||||
Syslog('b', "Will hangup");
|
||||
hangup();
|
||||
hangup();
|
||||
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)
|
||||
CreateSema((char *)"mailout");
|
||||
|
||||
@ -169,7 +175,8 @@ void Quick_Bye(int onsig)
|
||||
* Prevent that we call die() if something goes wrong next
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++)
|
||||
signal(i, SIG_DFL);
|
||||
if ((i == SIGHUP) || (i == SIGPIPE) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, SIG_DFL);
|
||||
|
||||
colour(LIGHTGRAY, BLACK);
|
||||
sleep(3);
|
||||
|
@ -78,12 +78,6 @@ int main(int argc, char **argv)
|
||||
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
|
||||
*/
|
||||
@ -114,8 +108,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
PUTSTR((char *)"Loading MBSE BBS ...");
|
||||
PUTCHAR('\r');
|
||||
PUTCHAR('\n');
|
||||
Enter(1);
|
||||
|
||||
if ((p = getenv("CONNECT")) != NULL)
|
||||
Syslog('+', "CONNECT %s", p);
|
||||
@ -156,8 +149,6 @@ int main(int argc, char **argv)
|
||||
signal(i, (void (*))die);
|
||||
else if (i == SIGCHLD)
|
||||
signal(i, SIG_DFL);
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -48,7 +48,7 @@ extern int hanged_up; /* Hanged up status */
|
||||
void die(int onsig)
|
||||
{
|
||||
if (onsig <= NSIG)
|
||||
signal(onsig, SIG_IGN);
|
||||
signal(onsig, SIG_DFL);
|
||||
|
||||
/*
|
||||
* First check if there is a child running, if so, kill it.
|
||||
|
Reference in New Issue
Block a user