diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-27 09:28:29 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-27 09:28:29 +0800 |
commit | 07b831073c7937008e0fd978edafc672424e449e (patch) | |
tree | 37f65848e9084a9377bb73db3a0bda954e8ac5f6 | |
parent | 57e9e375ada73192277977ba0d14e9530bdf40f9 (diff) | |
download | pttbbs-07b831073c7937008e0fd978edafc672424e449e.tar pttbbs-07b831073c7937008e0fd978edafc672424e449e.tar.gz pttbbs-07b831073c7937008e0fd978edafc672424e449e.tar.bz2 pttbbs-07b831073c7937008e0fd978edafc672424e449e.tar.lz pttbbs-07b831073c7937008e0fd978edafc672424e449e.tar.xz pttbbs-07b831073c7937008e0fd978edafc672424e449e.tar.zst pttbbs-07b831073c7937008e0fd978edafc672424e449e.zip |
show message to tell user crash
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2674 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/mbbsd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 5fe235e6..9a9b0ea7 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -202,13 +202,19 @@ abort_bbs_debug(int sig) { #ifdef DEBUGSLEEP static int reentrant = 0; +#endif +#define CRASH_MSG "\033[0m\r\n程式異常, 立刻斷線. 請洽 PttBug 板詳述你發生的問題.\n" + /* NOTE: It's better to use signal-safe functions. Avoid to call + * functions with global/static variable -- data may be corrupted */ + write(1, CRASH_MSG, sizeof(CRASH_MSG)); +#ifdef DEBUGSLEEP if (!reentrant) { int i; + reentrant = 1; /* close all file descriptors (including the network connection) */ for (i = 0; i < 256; ++i) close(i); - reentrant = 1; if (currmode) u_exit("AXXED"); #ifndef VALGRIND |