Fixed NetBSD hangup and character reading
This commit is contained in:
parent
fb76e3b6bb
commit
14db48511e
@ -121,8 +121,8 @@ void Good_Bye(int onsig)
|
|||||||
cookedport();
|
cookedport();
|
||||||
}
|
}
|
||||||
Syslog('b', "Will hangup");
|
Syslog('b', "Will hangup");
|
||||||
|
signal(SIGHUP, SIG_IGN);
|
||||||
hangup();
|
hangup();
|
||||||
Syslog('b', "Done");
|
|
||||||
|
|
||||||
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))
|
if ((i == SIGHUP) || (i == SIGPIPE) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||||
@ -170,6 +170,18 @@ void Quick_Bye(int onsig)
|
|||||||
sprintf(temp, "%s/tmp/mbsebbs%d", getenv("MBSE_ROOT"), getpid());
|
sprintf(temp, "%s/tmp/mbsebbs%d", getenv("MBSE_ROOT"), getpid());
|
||||||
unlink(temp);
|
unlink(temp);
|
||||||
free(temp);
|
free(temp);
|
||||||
|
colour(LIGHTGRAY, BLACK);
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
|
if ((onsig != SIGALRM) && (onsig != MBERR_TIMEOUT) && (hanged_up == 0)) {
|
||||||
|
cookedport();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore SIGHUP during hangup
|
||||||
|
*/
|
||||||
|
signal(SIGHUP, SIG_IGN);
|
||||||
|
hangup();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prevent that we call die() if something goes wrong next
|
* Prevent that we call die() if something goes wrong next
|
||||||
@ -178,12 +190,6 @@ void Quick_Bye(int onsig)
|
|||||||
if ((i == SIGHUP) || (i == SIGPIPE) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
if ((i == SIGHUP) || (i == SIGPIPE) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||||
signal(i, SIG_DFL);
|
signal(i, SIG_DFL);
|
||||||
|
|
||||||
colour(LIGHTGRAY, BLACK);
|
|
||||||
sleep(3);
|
|
||||||
|
|
||||||
cookedport();
|
|
||||||
hangup();
|
|
||||||
|
|
||||||
free(pTTY);
|
free(pTTY);
|
||||||
if (StartTime)
|
if (StartTime)
|
||||||
free(StartTime);
|
free(StartTime);
|
||||||
|
@ -53,7 +53,11 @@ int Waitchar(unsigned char *ch, int wtime)
|
|||||||
// Syslog('t', "Waitchar(): after GETCHAR() tty_status = %d, rc = %d", tty_status, rc);
|
// Syslog('t', "Waitchar(): after GETCHAR() tty_status = %d, rc = %d", tty_status, rc);
|
||||||
if (tty_status == STAT_SUCCESS) {
|
if (tty_status == STAT_SUCCESS) {
|
||||||
// Syslog('t', "Waitchar(): return %d", rc);
|
// Syslog('t', "Waitchar(): return %d", rc);
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
*ch = (unsigned char)rc;
|
||||||
|
#else
|
||||||
memcpy(ch, &rc, sizeof(unsigned char));
|
memcpy(ch, &rc, sizeof(unsigned char));
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (tty_status != STAT_TIMEOUT) {
|
if (tty_status != STAT_TIMEOUT) {
|
||||||
|
@ -625,6 +625,7 @@ void Fast_Bye(int onsig)
|
|||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
cookedport();
|
cookedport();
|
||||||
|
signal(SIGHUP, SIG_IGN);
|
||||||
hangup();
|
hangup();
|
||||||
|
|
||||||
Free_Language();
|
Free_Language();
|
||||||
|
Reference in New Issue
Block a user