From 004ac980dc3efde04fa9ec46ead0f7d42ab46e2d Mon Sep 17 00:00:00 2001 From: in2 Date: Sat, 18 May 2002 13:23:39 +0000 Subject: random sleep when logouting git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@182 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 8ea6f8d1..078245f4 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.27 2002/05/14 15:08:48 ptt Exp $ */ +/* $Id: mbbsd.c,v 1.28 2002/05/18 13:23:39 in2 Exp $ */ #include #include #include @@ -203,7 +203,14 @@ u_exit (char *mode) { //userec_t xuser; int diff = (time (0) - login_start_time) / 60; - + + /* close fd 0 & a to terminate network */ + close(0); + close(1); + + /* random sleep to avoid MANY users logout at the same time */ + usleep((int)((float)rand() * 10000000 / RAND_MAX)); + reload_money(); auto_backup (); save_brdbuf(); -- cgit v1.2.3