From 15c51977d80677d83fda2a62bcd52e19fb176a7a Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 12 Sep 2005 13:27:01 +0000 Subject: 1.now = time(NULL) instead of time(&now) 2.#if 0 for update_brd 3.fix compilation error when NOKILLWATERBALL & !OUTTATIMER (thanks rafan) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3164 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/shmctl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'util/shmctl.c') diff --git a/util/shmctl.c b/util/shmctl.c index 6dfc74ff..1a5fd525 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -161,7 +161,7 @@ int utmpfix(int argc, char **argv) #ifdef OUTTA_TIMER now = SHM->GV2.e.now; #else - time(&now); + now = time(NULL); #endif for( i = 0, nactive = 0 ; i < USHM_SIZE ; ++i ) if( SHM->uinfo[i].pid ){ @@ -664,12 +664,14 @@ int listbrd(int argc, char **argv) return 0; } +#if 0 static void update_brd(int i) { if(substitute_record(BBSHOME "/" FN_BOARD, &bcache[i],sizeof(boardheader_t),i+1) < 0) { printf("\n! CANNOT WRITE: " BBSHOME "/" FN_BOARD "\n"); exit(0); } } +#endif int fixbrd(int argc, char **argv) { @@ -798,7 +800,14 @@ int nkwbd(int argc, char **argv) case 0: /* child */ while( 1 ){ int i; - time_t t = SHM->GV2.e.now - timeout; + time_t now, t; + +#ifdef OUTTA_TIMER + now = SHM->GV2.e.now; +#else + now = time(NULL); +#endif + t = now - timeout; for( i = 0 ; i < USHM_SIZE ; ++i ) if( SHM->uinfo[i].pid && -- cgit v1.2.3