From: Lionel Sambuc Date: Thu, 28 Feb 2013 14:41:39 +0000 (+0100) Subject: Fix signal handling for services on abort/exit X-Git-Tag: v3.3.0~1103 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/mdoc.3.txt?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F376%2F2;p=minix.git Fix signal handling for services on abort/exit Change-Id: I970a25ae0dd52f0d928fda376296e7b39e3e17eb --- diff --git a/lib/libc/misc/stack_protector.c b/lib/libc/misc/stack_protector.c index ff26160c1..6569de866 100644 --- a/lib/libc/misc/stack_protector.c +++ b/lib/libc/misc/stack_protector.c @@ -86,7 +86,6 @@ __fail(const char *msg) #ifdef _LIBC struct syslog_data sdata = SYSLOG_DATA_INIT; struct sigaction sa; -#endif sigset_t mask; /* Immediately block all signal handlers from running code */ @@ -94,7 +93,6 @@ __fail(const char *msg) (void)sigdelset(&mask, SIGABRT); (void)sigprocmask(SIG_BLOCK, &mask, NULL); -#ifdef _LIBC /* This may fail on a chroot jail... */ syslog_ss(LOG_CRIT, &sdata, "%s", msg); #else diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c index 7f46b9ea0..1d14df6ac 100644 --- a/lib/libc/stdlib/abort.c +++ b/lib/libc/stdlib/abort.c @@ -43,6 +43,7 @@ __RCSID("$NetBSD: abort.c,v 1.15 2012/06/08 11:15:26 abs Exp $"); #include #include +#if defined(_LIBC) extern void (*__cleanup)(void); static int aborting = 0; @@ -82,3 +83,10 @@ abort(void) (void)raise(SIGABRT); _exit(1); } +#else +void +abort(void) +{ + exit(1); +} +#endif /* defined(_LIBC) */