From a1bd04d7decea39d51bbc06b50755976d4184c50 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 22 Jul 2002 16:50:36 +0000 Subject: fix utmpfix bug git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@434 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/shmctl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/util/shmctl.c b/util/shmctl.c index bdefc8e2..34276bb0 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -1,4 +1,4 @@ -/* $Id: shmctl.c,v 1.24 2002/07/05 10:59:29 in2 Exp $ */ +/* $Id: shmctl.c,v 1.25 2002/07/22 16:50:36 in2 Exp $ */ #include "bbs.h" extern SHM_t *SHM; @@ -55,7 +55,7 @@ int utmpfix(int argc, char **argv) timeout = atoi(optarg); break; default: - printf("usage:\tshmctl\tutmpfix[-n] [-t timeout]\n"); + printf("usage:\tshmctl\tutmpfix [-n] [-t timeout]\n"); return 1; } @@ -79,22 +79,22 @@ int utmpfix(int argc, char **argv) purge_utmp(&SHM->uinfo[i]); } else if( !fast ){ + if( searchuser(SHM->uinfo[i].userid) == 0 ){ + clean = "user not exist"; + } #ifdef DOTIMEOUT - if( now - SHM->uinfo[i].lastact > - (timeout == -1 ? IDLE_TIMEOUT : timeout) ){ + else if( now - SHM->uinfo[i].lastact > + (timeout == -1 ? IDLE_TIMEOUT : timeout) ){ sprintf(buf, "timeout(%s", ctime(&SHM->uinfo[i].lastact)); buf[strlen(buf) - 1] = 0; strcat(buf, ")"); clean = buf; kill(SHM->uinfo[i].pid, SIGHUP); - purge_utmp(&SHM->uinfo[i]); + printf("%s\n", buf); + continue; } - else #endif - if( searchuser(SHM->uinfo[i].userid) == 0 ){ - clean = "user not exist"; - } } if( clean ){ -- cgit v1.2.3