summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
commit6a428fb60d8ec6092d428b2e0f869a31f4890dc7 (patch)
treea0671ea2dc0168a9cb5625f867d553f6d0441efc /mbbsd/io.c
parent438c456b95eec0e5ac662ca3cf2386dff2c44bc7 (diff)
downloadpttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.gz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.bz2
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.lz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.xz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.zst
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.zip
replace time(NULL) by now
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@163 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 79a3874f..c969be8e 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.9 2002/04/28 19:35:29 in2 Exp $ */
+/* $Id: io.c,v 1.10 2002/05/13 03:20:04 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -41,28 +41,7 @@ static char outbuf[OBUFSIZE], inbuf[IBUFSIZE];
static int obufsize = 0, ibufsize = 0;
static int icurrchar = 0;
-/* ----------------------------------------------------- */
-/* 定時顯示動態看板 */
-/* ----------------------------------------------------- */
-extern userec_t cuser;
-
-static void hit_alarm_clock() {
- if(HAS_PERM(PERM_NOTIMEOUT) || PERM_HIDE(currutmp) || currstat == MAILALL)
- return;
-// if(time(0) - currutmp->lastact > IDLE_TIMEOUT - 2) {
- if(time(0) - currutmp->lastact > curr_idle_timeout - 2) {
- clear();
- if(currpid > 0) kill(currpid, SIGHUP);
- }
-// alarm(IDLE_TIMEOUT);
- alarm(curr_idle_timeout);
-}
-
-void init_alarm() {
- signal(SIGALRM, (void (*)(int))hit_alarm_clock);
-// alarm(IDLE_TIMEOUT);
- alarm(curr_idle_timeout);
-}
+time_t now;
/* ----------------------------------------------------- */
/* output routines */
@@ -148,7 +127,7 @@ int watermode = -1, wmofo = -1;
static int dogetch() {
int len;
-
+ static int count=0;
if(ibufsize <= icurrchar) {
if(flushf)
@@ -195,10 +174,20 @@ static int dogetch() {
}
if(currutmp)
- currutmp->lastact = time(0);
+ {
+ now= time(0);
+ if(now-currutmp->lastact<3)
+ count=0;
+ else
+ {
+ if(++count>100)
+ system_abort();
+ }
+ currutmp->lastact = now;
+ }
return inbuf[icurrchar++];
}
-
+extern userec_t cuser;
static int water_which_flag=0;
int igetch() {
register int ch;