From cab2869fc775ef730cebd0a0021d951208b7639f Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 7 May 2013 21:07:14 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4346 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_sys_unix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/server/sv_sys_unix.c b/engine/server/sv_sys_unix.c index 196e60db7..7f4f6c3e8 100644 --- a/engine/server/sv_sys_unix.c +++ b/engine/server/sv_sys_unix.c @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef __i386__ +#define _GNU_SOURCE //we need this in order to fix up broken backtraces. make sure its defined only where needed so we still some posixy conformance test on one plat. +#endif + #include #include #include @@ -670,8 +674,8 @@ static void Friendly_Crash_Handler(int sig, siginfo_t *info, void *vcontext) #if defined(__i386__) //x86 signals don't leave the stack in a clean state, so replace the signal handler with the real crash address, and hide this function - struct sig_ucontext *uc = vcontext; - array[1] = uc->uc_mcontext.eip; + ucontext_t *uc = vcontext; + array[1] = uc->uc_mcontext.gregs[REG_EIP]; firstframe = 1; #elif defined(__amd64__) //amd64 is sane enough, but this function and the libc signal handler are on the stack, and should be ignored.