summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-10 08:44:56 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-10 08:44:56 +0800
commitaed058b9cf94d0049f216460f98b6ad7ab81c80e (patch)
treeef6b129ccfec8cabc5577a63e90051a4d443af40 /mbbsd
parent4e23baabfaa4661b58dac17128e91d761df18ab3 (diff)
downloadpttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.tar
pttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.tar.gz
pttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.tar.bz2
pttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.tar.lz
pttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.tar.xz
pttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.tar.zst
pttbbs-aed058b9cf94d0049f216460f98b6ad7ab81c80e.zip
catch SIGXCPU for debug.piaip.automake@3147
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3147 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 1bac7469..83bdc709 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -219,6 +219,7 @@ abort_bbs_debug(int sig)
case SIGFPE: STATINC(STAT_SIGFPE); break;
case SIGBUS: STATINC(STAT_SIGBUS); break;
case SIGSEGV: STATINC(STAT_SIGSEGV); break;
+ case SIGXCPU: STATINC(STAT_SIGXCPU); break;
}
/* ignore normal signals */
Signal(SIGALRM, SIG_IGN);
@@ -237,6 +238,7 @@ abort_bbs_debug(int sig)
sigaddset(&sigset, SIGFPE);
sigaddset(&sigset, SIGBUS);
sigaddset(&sigset, SIGSEGV);
+ sigaddset(&sigset, SIGXCPU);
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
#define CRASH_MSG ANSI_COLOR(0) "\r\n程式異常, 立刻斷線. 請洽 PttBug 板詳述你發生的問題.\n"
@@ -1169,7 +1171,7 @@ start_client(void)
{
#ifdef CPULIMIT
struct rlimit rml;
- rml.rlim_cur = CPULIMIT * 60;
+ rml.rlim_cur = CPULIMIT * 60 - 5;
rml.rlim_max = CPULIMIT * 60;
setrlimit(RLIMIT_CPU, &rml);
#endif
@@ -1191,6 +1193,7 @@ start_client(void)
Signal(SIGFPE, abort_bbs_debug);
Signal(SIGBUS, abort_bbs_debug);
Signal(SIGSEGV, abort_bbs_debug);
+ Signal(SIGXCPU, abort_bbs_debug);
signal_restart(SIGUSR1, talk_request);
signal_restart(SIGUSR2, write_request);