diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-30 01:50:23 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-30 01:50:23 +0800 |
commit | d706913fa35ffa57bdbeed7804f499763d179fc0 (patch) | |
tree | 80a6c36b6dfa7a01b5ac78d5d86daa8ceaa591e3 | |
parent | 691a3343ad8952b5f542e8ce8944d1c939a90862 (diff) | |
download | pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.tar pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.tar.gz pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.tar.bz2 pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.tar.lz pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.tar.xz pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.tar.zst pttbbs-d706913fa35ffa57bdbeed7804f499763d179fc0.zip |
:)
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@73 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/shmctl.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/util/shmctl.c b/util/shmctl.c index 5932fdf3..b8f4c5a6 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -31,6 +31,13 @@ int utmpfix(int argc, char **argv) sprintf(buf, "/proc/%d", utmpshm->uinfo[i].pid); if( stat(buf, &st) < 0 ) clean = "process not exist"; + else{ + sprintf(buf, "home/%c/%s", + utmpshm->uinfo[i].userid[0], + utmpshm->uinfo[i].userid); + if( stat(buf, &st) < 0 ) + clean = "user not exist"; + } } if( clean ){ @@ -38,6 +45,11 @@ int utmpfix(int argc, char **argv) i, clean, utmpshm->uinfo[i].userid); memset(&utmpshm->uinfo[i], 0, sizeof(userinfo_t)); } + else if ( utmpshm->uinfo[i].mind > 40 ){ + printf("mind fix: %06d, userid: %s, mind: %d\n", + i, utmpshm->uinfo[i].userid, utmpshm->uinfo[i].mind); + utmpshm->uinfo[i].mind %= 40; + } } utmpshm->busystate = 0; return 0; @@ -165,17 +177,18 @@ int utmpsort(int argc, char **argv) } /* end of ulistsort */ +#define TIMES 10 int utmpwatch(int argc, char **argv) { int i; while( 1 ){ - for( i = 0 ; i < 4 ; ++i ){ + for( i = 0 ; i < TIMES ; ++i ){ usleep(300); if( !utmpshm->busystate ) break; puts("busying..."); } - if( i == 4 ){ + if( i == TIMES ){ puts("reset!"); utmpshm->busystate = 0; } @@ -199,6 +212,7 @@ int main(int argc, char **argv) int i = 0; if( argc >= 2 ){ + chdir(BBSHOME); resolve_utmp(); resolve_boards(); //resolve_garbage(); |