summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-18 21:23:39 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-18 21:23:39 +0800
commit004ac980dc3efde04fa9ec46ead0f7d42ab46e2d (patch)
treeefcf44e03eba710a21c19362555c06d2b457fa6f /mbbsd
parenta2668d9b5d10e98447fb8e5110240d1757bc1ebe (diff)
downloadpttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.tar
pttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.tar.gz
pttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.tar.bz2
pttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.tar.lz
pttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.tar.xz
pttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.tar.zst
pttbbs-004ac980dc3efde04fa9ec46ead0f7d42ab46e2d.zip
random sleep when logouting
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@182 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c11
1 files changed, 9 insertions, 2 deletions
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 <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -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();