summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-10 04:10:31 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-10 04:10:31 +0800
commitbee171e6635b88aa65c696f4ff2665cddf886e48 (patch)
treea44eb6738c799bc4ec392c0f10f004374ca8a34a /mbbsd
parent1334ecd6b1bc494e0ddc18055b650d1f31334842 (diff)
downloadpttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.tar
pttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.tar.gz
pttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.tar.bz2
pttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.tar.lz
pttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.tar.xz
pttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.tar.zst
pttbbs-bee171e6635b88aa65c696f4ff2665cddf886e48.zip
remove pickup_t:idle, clean of idle timeout to shmctl
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@92 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/talk.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index c9b108c8..d2c6fb8a 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.18 2002/03/20 13:49:45 ptt Exp $ */
+/* $Id: talk.c,v 1.19 2002/04/09 20:10:31 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -69,7 +69,7 @@ typedef struct talkwin_t {
typedef struct pickup_t {
userinfo_t *ui;
- time_t idle;
+ //time_t idle;
int friend;
} pickup_t;
@@ -1525,7 +1525,7 @@ static int pickup_user_cmp(time_t now, int sortedway, int cmp_fri,
pickup_t pklist[], int *bfriends_number, int *ifh_number,
int *hfm_number,int *irh_number, char *keyword)
{
- int i, fri_stat, is_friend, count=0, diff;
+ int i, fri_stat, is_friend, count=0;
userinfo_t *uentp;
for (i=0;i<utmpshm->number;i++){
uentp = (utmpshm->sorted[utmpshm->currsorted][sortedway][i]);
@@ -1544,10 +1544,12 @@ static int pickup_user_cmp(time_t now, int sortedway, int cmp_fri,
if (ifh_number && fri_stat & IFH) (*ifh_number)++;
if (hfm_number && fri_stat & HFM) (*hfm_number)++;
if (irh_number && fri_stat & IRH) (*irh_number)++;
+#if 0
#ifdef SHOW_IDLE_TIME
diff = now - uentp->lastact;
#ifdef DOTIMEOUT
- /* prevent fault /dev mount from kicking out users */
+ /* in2: timeout拿到 shmctl utmpfix去做, 一小時一次就夠了 */
+ /* prevent fault /dev mount from kicking out users */
if ((diff > curr_idle_timeout + 10) &&
(diff < 60 * 60 * 24 * 5)){
if ((uentp->pid <= 0 || kill(uentp->pid, SIGHUP) == -1) &&
@@ -1558,6 +1560,7 @@ static int pickup_user_cmp(time_t now, int sortedway, int cmp_fri,
#endif
pklist[count].idle = diff;
#endif
+#endif
pklist[count].friend = fri_stat;
pklist[count].ui = uentp;
count++;
@@ -1721,7 +1724,8 @@ static void pickup_user(void)
continue;
}
#ifdef SHOW_IDLE_TIME
- diff = pklist[ch].idle;
+ diff = freshtime - pklist[ch].ui->lastact;
+ //diff = pklist[ch].idle;
if (diff > 59990) diff = 59990; /* Doma: 以免一大串的發呆時間 */
if (diff > 0)
sprintf(buf, "%3ld'%02ld", diff / 60, diff % 60);