diff options
author | Ira Cooper <ira@samba.org> | 2012-03-14 12:56:02 -0400 |
---|---|---|
committer | Ira Cooper <ira@samba.org> | 2012-03-15 05:55:03 +0100 |
commit | b990279304b5e2b2ee0f64480cb09eda33f76beb (patch) | |
tree | 99620a21f1ec21f02e320298fba30f306e9f15ef | |
parent | 48c2f803e8550a1d321d7312563a6f08bb89f096 (diff) | |
download | samba-b990279304b5e2b2ee0f64480cb09eda33f76beb.tar.gz samba-b990279304b5e2b2ee0f64480cb09eda33f76beb.tar.bz2 samba-b990279304b5e2b2ee0f64480cb09eda33f76beb.zip |
util: Add --disable-fault-handling.
On some platforms you can not debug coredumps after the default signal handler
gets done dumping core. This allows waf to have an option to disable our
default signal handler.
-rw-r--r-- | lib/util/fault.c | 2 | ||||
-rw-r--r-- | lib/util/wscript | 3 | ||||
-rw-r--r-- | lib/util/wscript_configure | 3 | ||||
-rw-r--r-- | source3/configure.in | 7 | ||||
-rwxr-xr-x | wscript | 1 |
5 files changed, 16 insertions, 0 deletions
diff --git a/lib/util/fault.c b/lib/util/fault.c index 7fe081d285..b3527bb22e 100644 --- a/lib/util/fault.c +++ b/lib/util/fault.c @@ -96,6 +96,7 @@ void fault_setup(void) if (fault_state.disabled) { return; } +#if !defined(HAVE_DISABLE_FAULT_HANDLING) #ifdef SIGSEGV CatchSignal(SIGSEGV, sig_fault); #endif @@ -105,6 +106,7 @@ void fault_setup(void) #ifdef SIGABRT CatchSignal(SIGABRT, sig_fault); #endif +#endif } _PUBLIC_ const char *panic_action = NULL; diff --git a/lib/util/wscript b/lib/util/wscript new file mode 100644 index 0000000000..d296e7565b --- /dev/null +++ b/lib/util/wscript @@ -0,0 +1,3 @@ +def set_options(opt): + ''' This is a bit strange, but disable is the flag, not enable. ''' + opt.add_option('--disable-fault-handling', action='store_true', dest='disable_fault_handling', help=('disable the fault handlers'), default=False) diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure index fdaf67acb3..ad55476c7d 100644 --- a/lib/util/wscript_configure +++ b/lib/util/wscript_configure @@ -1,5 +1,8 @@ #!/usr/bin/env python +import Options +if Options.options.disable_fault_handling: + conf.DEFINE('HAVE_DISABLE_FAULT_HANDLING',1) # backtrace could be in libexecinfo or in libc conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h') diff --git a/source3/configure.in b/source3/configure.in index 611e1d8fb6..51e163dfb1 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -6799,6 +6799,7 @@ if test x"$enable_pthreadpool" = x"yes" -a x"$samba_cv_HAVE_PTHREAD" = x"yes"; t fi fi + ################################################# # Check to see if we should use the included iniparser @@ -6834,6 +6835,12 @@ AC_SUBST(BUILD_INIPARSER) AC_SUBST(INIPARSERLIBS) AC_SUBST(FLAGS1) +AC_ARG_ENABLE(fault-handler,[AS_HELP_STRING([--disable-fault-handler], [Disable the default handler])]) + +if test x"$enable_fault_handler" = x"no"; then + AC_DEFINE(HAVE_DISABLE_FAULT_HANDLER, 1, [Disable the default signal handler]) +fi + ################################################### # Check for different/missing (set|get|end)netgrent prototypes CFLAGS_SAVE=$CFLAGS @@ -30,6 +30,7 @@ def set_options(opt): opt.RECURSE('lib/uid_wrapper') opt.RECURSE('pidl') opt.RECURSE('source3') + opt.RECURSE('lib/util') gr = opt.option_group('developer options') gr.add_option('--enable-build-farm', |