summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-26 00:20:20 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-26 00:20:20 +0800
commit7bf58d611c172a81c6dbd595157fb6d226a72ae5 (patch)
tree55b4d2cd20fd3e54de353e7c81f32009b9440aee /util
parentf491fb7f32b6e2a9474b82660f7587f90344d4d3 (diff)
downloadpttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.tar
pttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.tar.gz
pttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.tar.bz2
pttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.tar.lz
pttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.tar.xz
pttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.tar.zst
pttbbs-7bf58d611c172a81c6dbd595157fb6d226a72ae5.zip
add utmpwatch
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@67 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/shmctl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/util/shmctl.c b/util/shmctl.c
index f8698398..5932fdf3 100644
--- a/util/shmctl.c
+++ b/util/shmctl.c
@@ -165,6 +165,24 @@ int utmpsort(int argc, char **argv)
}
/* end of ulistsort */
+int utmpwatch(int argc, char **argv)
+{
+ int i;
+ while( 1 ){
+ for( i = 0 ; i < 4 ; ++i ){
+ usleep(300);
+ if( !utmpshm->busystate )
+ break;
+ puts("busying...");
+ }
+ if( i == 4 ){
+ puts("reset!");
+ utmpshm->busystate = 0;
+ }
+ }
+ return 0;
+}
+
struct {
int (*func)(int, char **);
char *cmd, *descript;
@@ -173,6 +191,7 @@ struct {
{utmpstate, "utmpstate", "list utmpstate"},
{utmpreset, "utmpreset", "utmpshm->busystate=0"},
{utmpsort, "utmpsort", "sort ulist"},
+ {utmpwatch, "utmpwatch", "to see if busystate is always 1 then fix it"},
{NULL, NULL, NULL} };
int main(int argc, char **argv)