From d365e7cace5e16046b3c5ca876d02e33c97014d2 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 24 May 2004 05:49:50 +0000 Subject: add reloadbcache git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2016 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/shmctl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/shmctl.c b/util/shmctl.c index 82778162..54757795 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -23,7 +23,7 @@ int logout_friend_online(userinfo_t *utmp) if(ui->pid && ui!=utmp){ for(k=0; kfriendtotal && (int)(ui->friend_online[k] & 0xFFFFFF) !=offset; k++); - if(kfriendtotal){ + if( k < ui->friendtotal && k < MAX_FRIEND ){ ui->friendtotal--; ui->friend_online[k]=ui->friend_online[ui->friendtotal]; ui->friend_online[ui->friendtotal]=0; @@ -701,6 +701,13 @@ int usermode(int argc, char **argv) return 0; } +int torb(int argc, char **argv) +{ + reload_bcache(); + puts("bcache reloaded"); + return 0; +} + struct { int (*func)(int, char **); char *cmd, *descript; @@ -725,6 +732,7 @@ struct { {SHMinit, "SHMinit", "initialize SHM (including uhash_loader)"}, {hotboard, "hotboard", "list boards of most bfriends"}, {usermode, "usermode", "list #users in the same mode"}, + {torb, "reloadbcache", "reload bcache"}, {NULL, NULL, NULL} }; extern char ** environ; -- cgit v1.2.3