summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-16 10:30:30 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-16 10:30:30 +0800
commitcf83920428b3cfdfe2a5f7d6fc10b1956851f4fa (patch)
treea2078acd1b071a7ef55266ba688c97c2e7f73cae
parentbc871aca5918c170b108c5c5691bd404669ab678 (diff)
downloadpttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.tar
pttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.tar.gz
pttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.tar.bz2
pttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.tar.lz
pttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.tar.xz
pttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.tar.zst
pttbbs-cf83920428b3cfdfe2a5f7d6fc10b1956851f4fa.zip
show timeout time
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@177 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/shmctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/shmctl.c b/util/shmctl.c
index 970919bc..738926b9 100644
--- a/util/shmctl.c
+++ b/util/shmctl.c
@@ -54,7 +54,7 @@ int utmpfix(int argc, char **argv)
{
int i, fast = 0;
time_t now;
- char *clean;
+ char *clean, buf[1024];
if( argc >= 1 && strcmp(argv[0], "-n") == 0 )
fast = 1;
@@ -77,7 +77,10 @@ int utmpfix(int argc, char **argv)
else if( !fast ){
#ifdef DOTIMEOUT
if( now - utmpshm->uinfo[i].lastact > IDLE_TIMEOUT ){
- clean = "timeout";
+ sprintf(buf, "timeout(%s",
+ ctime(&utmpshm->uinfo[i].lastact));
+ buf[strlen(buf) - 1] = 0;
+ strcat(buf, ")");
kill(utmpshm->uinfo[i].pid, SIGHUP);
purge_utmp(&utmpshm->uinfo[i]);
}