From 9a51fba71c5fa7082c331e1a78a98638d9aa06cf Mon Sep 17 00:00:00 2001 From: James Peach Date: Tue, 7 Nov 2006 17:18:00 +0000 Subject: r19626: Coalesce usage of DUMP_CORE. Fix formatting on chdir error message in core dump path. --- source/lib/fault.c | 7 ++++++- source/nmbd/nmbd.c | 2 -- source/nsswitch/winbindd.c | 2 -- source/smbd/server.c | 2 -- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/lib/fault.c b/source/lib/fault.c index dc8c276d02c..b632a5c82fa 100644 --- a/source/lib/fault.c +++ b/source/lib/fault.c @@ -160,12 +160,13 @@ void dump_core_setup(const char *progname) exit(1); } +#if DUMP_CORE if (*corepath != '\0') { /* The chdir might fail if we dump core before we finish * processing the config file. */ if (chdir(corepath) != 0) { - DEBUG(0, ("unable to change to %s", corepath)); + DEBUG(0, ("unable to change to %s\n", corepath)); DEBUGADD(0, ("refusing to dump core\n")); exit(1); } @@ -182,5 +183,9 @@ void dump_core_setup(const char *progname) #endif abort(); + +#else /* DUMP_CORE */ + exit(1); +#endif /* DUMP_CORE */ } diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index 26495d25c13..4a05fde28c9 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -112,9 +112,7 @@ static void sig_hup(int sig) static void fault_continue(void) { -#if DUMP_CORE dump_core(); -#endif } /**************************************************************************** ** diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index 6e61df99f1f..e9e51449d65 100644 --- a/source/nsswitch/winbindd.c +++ b/source/nsswitch/winbindd.c @@ -65,9 +65,7 @@ static BOOL reload_services_file(void) static void fault_quit(void) { -#if DUMP_CORE dump_core(); -#endif } static void winbindd_status(void) diff --git a/source/smbd/server.c b/source/smbd/server.c index a7a84eced14..593e2bfb12d 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -725,9 +725,7 @@ static void exit_server_common(enum server_exit_reason how, } DEBUGLEVEL = oldlevel; -#if DUMP_CORE dump_core(); -#endif } else { DEBUG(3,("Server exit (%s)\n", -- cgit