summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-23 00:50:36 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-23 00:50:36 +0800
commita1bd04d7decea39d51bbc06b50755976d4184c50 (patch)
tree0ff7ebdf0bc6e7e49005260de2bc07c6c3b7eb14
parent794e6ac903d44610a7e92bce0824b602d26d968d (diff)
downloadpttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.tar
pttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.tar.gz
pttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.tar.bz2
pttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.tar.lz
pttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.tar.xz
pttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.tar.zst
pttbbs-a1bd04d7decea39d51bbc06b50755976d4184c50.zip
fix utmpfix bug
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@434 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/shmctl.c18
1 files 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 ){