r19626: Coalesce usage of DUMP_CORE. Fix formatting on chdir error message
authorJames Peach <jpeach@samba.org>
Tue, 7 Nov 2006 17:18:00 +0000 (17:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:15:42 +0000 (12:15 -0500)
in core dump path.
(This used to be commit 9a51fba71c5fa7082c331e1a78a98638d9aa06cf)

source3/lib/fault.c
source3/nmbd/nmbd.c
source3/nsswitch/winbindd.c
source3/smbd/server.c

index dc8c276d02cccbf2e0c8543bd1fb7bc739a687ff..b632a5c82fa2f84fd3132052a9cf999bf7c5cc04 100644 (file)
@@ -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 */
 }
 
index 26495d25c13a3f6df6847f49223027ee8164adae..4a05fde28c9b40400fb64b413292c63ba7405e42 100644 (file)
@@ -112,9 +112,7 @@ static void sig_hup(int sig)
 
 static void fault_continue(void)
 {
-#if DUMP_CORE
        dump_core();
-#endif
 }
 
 /**************************************************************************** **
index 6e61df99f1fefee2dbb78f98267a6990de05c78b..e9e51449d656fe609909ff7537eef3137c32baac 100644 (file)
@@ -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)
index a7a84eced144cce0d74cc0ab1423ef10cde33c9b..593e2bfb12d786410ef2560aeb27dc92d475110f 100644 (file)
@@ -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",