From 62b8015b4e30278ae3b533e9ac6c861c31433d70 Mon Sep 17 00:00:00 2001 From: victor Date: Sat, 17 May 2003 04:41:02 +0000 Subject: outta timer:p git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@861 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/shmctl.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/shmctl.c b/util/shmctl.c index 0348c768..86e65cb3 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -1,4 +1,4 @@ -/* $Id: shmctl.c,v 1.41 2003/05/15 06:48:46 in2 Exp $ */ +/* $Id: shmctl.c,v 1.42 2003/05/17 04:41:02 victor Exp $ */ #include "bbs.h" #include @@ -87,7 +87,11 @@ int utmpfix(int argc, char **argv) SHM->UTMPbusystate = 1; printf("starting scaning... %s \n", (fast ? "(fast mode)" : "")); +#ifdef OUTTA_TIMER + now = SHM->GV2.e.now; +#else time(&now); +#endif for( i = 0, nactive = 0 ; i < USHM_SIZE ; ++i ) if( SHM->uinfo[i].pid ){ idle[nactive].index = i; @@ -208,7 +212,11 @@ inline void utmpsort(void) short nusers[MAX_BOARD]; SHM->UTMPbusystate = 1; +#ifdef OUTTA_TIMER + SHM->UTMPuptime = SHM->GV2.e.now; +#else SHM->UTMPuptime = time(NULL); +#endif ns = (SHM->currsorted ? 0 : 1); for (uentp = &SHM->uinfo[0], count = i = 0; @@ -299,9 +307,13 @@ int utmpstate(int argc, char **argv) { time_t now; char upbuf[64], nowbuf[64]; +#ifdef OUTTA_TIMER + now = SHM->GV2.e.now; +#else now = time(NULL); +#endif CTIMEx(upbuf, SHM->UTMPuptime); - CTIMEx(nowbuf, time(NULL)); + CTIMEx(nowbuf, now); printf("now: %s\n", nowbuf); printf("currsorted: %d\n", SHM->currsorted); printf("uptime: %s\n", upbuf); -- cgit v1.2.3