Skip to content

Commit

Permalink
Use the correct macro to include backtrace
Browse files Browse the repository at this point in the history
execinfo.h and backtrace() are GNU extensions provided by glibc
and not by gcc, see:

http://www.gnu.org/software/libc/manual/html_mono/libc.html#Backtraces

Signed-off-by: Carlo Landmeter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4453
  • Loading branch information
clandmeter authored and behlendorf committed Mar 30, 2016
1 parent 1ad32f0 commit 967798d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/ztest/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
#include <math.h>
#include <sys/fs/zfs.h>
#include <libnvpair.h>
#ifdef __GNUC__
#ifdef __GLIBC__
#include <execinfo.h> /* for backtrace() */
#endif

Expand Down Expand Up @@ -490,7 +490,7 @@ _umem_logging_init(void)
static void sig_handler(int signo)
{
struct sigaction action;
#ifdef __GNUC__ /* backtrace() is a GNU extension */
#ifdef __GLIBC__ /* backtrace() is a GNU extension */
int nptrs;
void *buffer[BACKTRACE_SZ];

Expand Down

0 comments on commit 967798d

Please sign in to comment.