diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2010-12-13 17:13:31 +0100 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2010-12-13 17:13:31 +0100 |
commit | 82474d91d9dcb5de9975b3e73bd375aeedb1f1be (patch) | |
tree | 29b2ec94b1ecfb3642452828439a196ccf1a68f3 | |
parent | 92c303ced656b2e759cbd4c71e3132d819c87a8b (diff) | |
parent | 7c36c7e93cd154c8f154a1bc33c9a7557c5caa8d (diff) | |
download | mariadb-git-82474d91d9dcb5de9975b3e73bd375aeedb1f1be.tar.gz |
Automerge 5.1-bugteam => 5.5-bugteam
-rw-r--r-- | dbug/dbug.c | 19 | ||||
-rw-r--r-- | include/my_dbug.h | 3 |
2 files changed, 21 insertions, 1 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index df26e2ee8ef..74568f55fe0 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2377,6 +2377,25 @@ void _db_flush_() } +#ifndef __WIN__ +void _db_suicide_() +{ + int retval; + sigset_t new_mask; + sigfillset(&new_mask); + + fprintf(stderr, "SIGKILL myself\n"); + fflush(stderr); + + retval= kill(getpid(), SIGKILL); + assert(retval == 0); + retval= sigsuspend(&new_mask); + fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno); + assert(FALSE); /* With full signal mask, we should never return here. */ +} +#endif /* ! __WIN__ */ + + void _db_lock_file_() { CODE_STATE *cs; diff --git a/include/my_dbug.h b/include/my_dbug.h index e1cb3252601..7f8f5a1578d 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -132,7 +132,8 @@ extern const char* _db_get_func_(void); #ifdef __WIN__ #define DBUG_SUICIDE() DBUG_ABORT() #else -#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause()) +extern void _db_suicide_(); +#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_()) #endif #else /* No debugger */ |