diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-01-03 16:33:17 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-01-03 16:33:17 +0800 |
commit | ed3cd01e35334c4577380483a9cd6f443c282b49 (patch) | |
tree | 5dafe6ee8a5ca051d9087b57f1f8c78df6de468b | |
parent | 8ffed74f0ca041f01dcbf8915775c07023ad5616 (diff) | |
download | pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.tar pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.tar.gz pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.tar.bz2 pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.tar.lz pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.tar.xz pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.tar.zst pttbbs-ed3cd01e35334c4577380483a9cd6f443c282b49.zip |
set default to 20, 20,
remove debug message,
show sleeptime, timeout on proctitle.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1450 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/shmctl.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/util/shmctl.c b/util/shmctl.c index e5539b23..5cf4edc2 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -496,20 +496,20 @@ int bBMC(int argc, char **argv) #ifdef NOKILLWATERBALL int nkwbd(int argc, char **argv) { - int ch, sleeptime = 120, timeout = 120; + int ch, sleeptime = 20, timeout = 20; while( (ch = getopt(argc, argv, "s:t:h")) != -1 ) switch( ch ){ case 's': if( (sleeptime = atoi(optarg)) < 10 ){ - fprintf(stderr, "sleeptime < 10? set to 60"); - sleeptime = 60; + fprintf(stderr, "sleeptime < 10? set to 20"); + sleeptime = 20; } break; case 't': if( (timeout = atoi(optarg)) < 10 ){ - fprintf(stderr, "timeout < 10? set to 60"); - timeout = 60; + fprintf(stderr, "timeout < 10? set to 20"); + timeout = 20; } break; @@ -518,7 +518,7 @@ int nkwbd(int argc, char **argv) return 0; } - setproctitle("shmctl nkwbd"); + setproctitle("shmctl nkwbd(sleep%d,timeout%d)", sleeptime, timeout); switch( fork() ){ case -1: @@ -531,16 +531,13 @@ int nkwbd(int argc, char **argv) int i; time_t t = SHM->GV2.e.now - timeout; - printf("scanning\n"); for( i = 0 ; i < MAX_ACTIVE ; ++i ) if( SHM->uinfo[i].pid && SHM->uinfo[i].wbtime && SHM->uinfo[i].wbtime < t ){ - printf("kill: %d\n", SHM->uinfo[i].pid); kill(SHM->uinfo[i].pid, SIGUSR2); SHM->uinfo[i].wbtime = 0; /* race */ } - printf("scanned\n"); sleep(sleeptime); } break; |