diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-17 12:41:02 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-17 12:41:02 +0800 |
commit | 62b8015b4e30278ae3b533e9ac6c861c31433d70 (patch) | |
tree | 89c5c2317415de4bf53db6cf91adf433c1eff2a6 | |
parent | 083f6979585e3d38a20ede2cdbb9867ff99c06e7 (diff) | |
download | pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.tar pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.tar.gz pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.tar.bz2 pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.tar.lz pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.tar.xz pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.tar.zst pttbbs-62b8015b4e30278ae3b533e9ac6c861c31433d70.zip |
outta timer:p
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@861 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/shmctl.c | 16 |
1 files changed, 14 insertions, 2 deletions
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 <sys/wait.h> @@ -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); |