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 | 8d311a855164416744c35742a3e1368c49ca6c1a (patch) | |
tree | 29b2ec94b1ecfb3642452828439a196ccf1a68f3 | |
parent | e52e64ac35670a7359b16bff5c0073aa13d3abc3 (diff) | |
parent | 0611bf22031283a6b459223eec199f0c0c7ae606 (diff) | |
download | mariadb-git-8d311a855164416744c35742a3e1368c49ca6c1a.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 */ |