diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-16 00:52:22 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-16 00:52:22 +0800 |
commit | 4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912 (patch) | |
tree | b7fcc63228a4eb7f1096fc5080968ed2e9c39955 /mbbsd/mbbsd.c | |
parent | 1f2456d052f54631285a96959e774c3f008846f1 (diff) | |
download | pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.tar pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.tar.gz pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.tar.bz2 pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.tar.lz pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.tar.xz pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.tar.zst pttbbs-4d00526c4b1a2cc3e60f5adcf7c8bb5a4dc20912.zip |
verbose msg and skip multilogin check for debugsleeping
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3178 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 83bdc709..59ca1b1e 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -208,7 +208,7 @@ static void abort_bbs_debug(int sig) GCC_NORETURN; static void abort_bbs_debug(int sig) { - int i; + int i; sigset_t sigset; switch(sig) { @@ -250,7 +250,8 @@ abort_bbs_debug(int sig) /* log */ /* assume vsnprintf() in log_file() is signal-safe, is it? */ - log_file("log/crash.log", LOG_VF|LOG_CREAT, "%ld %d\n", time4(NULL), getpid()); + log_file("log/crash.log", LOG_VF|LOG_CREAT, + "%ld %d\n", time4(NULL), getpid()); /* try logout... not a good idea, maybe crash again. now disabled */ /* @@ -264,8 +265,14 @@ abort_bbs_debug(int sig) #ifndef VALGRIND setproctitle("debug me!(%d)(%s,%d)", sig, cuser.userid, currstat); #endif + /* do this manually to prevent broken stuff */ + /* will broken currutmp cause problems here? hope not... */ + if(currutmp) + currutmp->mode = DEBUGSLEEPING; + sleep(3600); /* wait 60 mins for debug */ #endif + exit(0); } @@ -512,6 +519,16 @@ multi_user_check(void) if (!(ui = (userinfo_t *) search_ulist(usernum))) return; /* user isn't logged in */ +#ifdef DEBUGSLEEP + /* skip sleeping process */ + while (ui->pid && + (ui->uid == usernum && ui->mode == DEBUGSLEEPING)) + ui++; + + if(ui->uid != usernum) + return; +#endif + pid = ui->pid; if (!pid /* || (kill(pid, 0) == -1) */ ) return; /* stale entry in utmp file */ @@ -524,6 +541,7 @@ multi_user_check(void) kill(pid, SIGHUP); log_usies("KICK ", cuser.nickname); } else { + /* what are we doing here? magic number 3? */ if (search_ulistn(usernum, 3) != NULL) abort_bbs(0); /* Goodbye(); */ } |