From 8a59793d06adf210e2330b4c63425ea0bc61f086 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 4 Nov 2004 20:49:32 +0000 Subject: [PATCH] Updates for terminal i/o --- ChangeLog | 3 ++- mbsebbs/bye.c | 2 +- mbsebbs/door.c | 4 ++-- mbsebbs/mbsebbs.c | 19 +++++++++++++++++++ mbsebbs/timeout.c | 6 ++++-- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60b7ad75..2515926b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ v0.71.0 27-Oct-2004 mbsebbs: In change handle the first character of the name is not capitalized. - Changed layout of raw directory listing to support long + Changed layout of raw directory listing to support longer filenames. Rewrote terminal i/o. If a user pages the sysop a hint is displayed to fill in the @@ -24,6 +24,7 @@ v0.71.0 27-Oct-2004 examples: Fixed logo display. + Fixed Spanish txtfiles to leave out an old support bbs. v0.70.0 06-Jun-2004 - 26-Oct-2004. diff --git a/mbsebbs/bye.c b/mbsebbs/bye.c index daddf7c6..07ecfcc1 100644 --- a/mbsebbs/bye.c +++ b/mbsebbs/bye.c @@ -66,7 +66,7 @@ void Good_Bye(int onsig) * Don't display goodbye screen on SIGHUP and idle timeout. * With idle timeout this will go into a loop. */ - if ((onsig != SIGHUP) && (onsig != SIGALRM) && (onsig != MBERR_TIMEOUT) && (hanged_up == 0)) + if ((onsig != SIGALRM) && (onsig != MBERR_TIMEOUT) && (hanged_up == 0)) DisplayFile((char *)"goodbye"); if (do_mailout) diff --git a/mbsebbs/door.c b/mbsebbs/door.c index b17e4b8d..09ec98fb 100644 --- a/mbsebbs/door.c +++ b/mbsebbs/door.c @@ -291,14 +291,14 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu } clear(); - PUTSTR((char *)"Loading ..."); + PUTSTR((char *)"Loading, please wait ..."); Enter(2); /* * Put terminal back in cooked mode, prefered by some doors. */ cookedport(); - + if (NoSuid) rc = exec_nosuid(Program); else diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index 2eef9525..fee102a5 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -146,6 +146,25 @@ int main(int argc, char **argv) sprintf(pTTY, "%s", tty); } + /* + * Now that we have all terminal information, we close the tty and + * reopen the default tty so that doors will work. + */ +// cookedport(); +// close(0); +// close(1); +// if ((i = open("/dev/tty", O_RDWR|O_NONBLOCK)) < 0) { +// perror("open 0"); +// exit(MBERR_TTYIO_ERROR); +// } +// Syslog('t', "new fd %d", i); +// if ((i = open("/dev/tty", O_RDWR|O_NONBLOCK)) < 0) { +// perror("open 1"); +// exit(MBERR_TTYIO_ERROR); +// } +// Syslog('t', "new fd %d", i); +// rawport(); + umask(007); /* diff --git a/mbsebbs/timeout.c b/mbsebbs/timeout.c index d67b0c9c..6bef44d8 100644 --- a/mbsebbs/timeout.c +++ b/mbsebbs/timeout.c @@ -80,10 +80,12 @@ void die(int onsig) } else if (onsig == SIGALRM) { Syslog('+', "User inactivity timeout"); } else { - if (onsig <= NSIG) + if (onsig <= NSIG) { + hanged_up = 1; WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]); - else + } else { WriteError("Terminated with error %d", onsig); + } } } else { Syslog(' ', "Terminated by user");