summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/fault.c14
-rw-r--r--lib/util/util.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/util/fault.c b/lib/util/fault.c
index bbb3190198..256e55a85b 100644
--- a/lib/util/fault.c
+++ b/lib/util/fault.c
@@ -187,9 +187,10 @@ setup our fault handlers
**/
_PUBLIC_ void fault_setup(const char *pname)
{
- if (progname == NULL) {
- progname = pname;
+ if (progname != NULL) {
+ return;
}
+ progname = pname;
#ifdef SIGSEGV
CatchSignal(SIGSEGV, sig_fault);
#endif
@@ -205,6 +206,15 @@ _PUBLIC_ void fault_setup(const char *pname)
}
/**
+ disable setting up fault handlers
+**/
+_PUBLIC_ void fault_setup_disable(void)
+{
+ progname = "fault disabled";
+}
+
+
+/**
register a fault handler.
Should only be called once in the execution of smbd.
*/
diff --git a/lib/util/util.h b/lib/util/util.h
index 0073aa9051..86bb3daace 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -87,6 +87,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *why);
setup our fault handlers
**/
_PUBLIC_ void fault_setup(const char *pname);
+_PUBLIC_ void fault_setup_disable(void);
#endif
/**