s4:cmdline: setup talloc log and abort functions
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jul 2009 06:37:01 +0000 (08:37 +0200)
committerAndrew Tridgell <tridge@samba.org>
Mon, 24 Aug 2009 06:29:59 +0000 (16:29 +1000)
metze

source4/include/includes.h
source4/lib/cmdline/popt_common.c

index e94c0fe633906afbd7d4108d1b976fd7ba9aba00..babef870b1cbb18863084a7b1eea7dcdcd3cfa5e 100644 (file)
 #include "../lib/util/smb_threads.h"
 #include "../lib/util/smb_threads_internal.h"
 
-#if 0
-/* darn, we can't do this now that we don't link the ldb tools to all the smb libs */
-#define TALLOC_ABORT(reason) smb_panic(reason)
-#endif
-
 #if defined(UID_WRAPPER)
 #if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE)
 #define UID_WRAPPER_REPLACE
index 712d99996c92b5666f368f86c067df99c8f14018..0273c4fe1c6c3af3a8a113eb3a734206732601d3 100644 (file)
@@ -53,6 +53,11 @@ static void popt_version_callback(poptContext con,
        }
 }
 
+static void popt_s4_talloc_log_fn(const char *message)
+{
+       DEBUG(0,("%s", message));
+}
+
 static void popt_samba_callback(poptContext con, 
                           enum poptCallbackReason reason,
                           const struct poptOption *opt,
@@ -86,6 +91,8 @@ static void popt_samba_callback(poptContext con,
 
                /* and logging */
                setup_logging(pname, DEBUG_STDOUT);
+               talloc_set_log_fn(popt_s4_talloc_log_fn);
+               talloc_set_abort_fn(smb_panic);
 
                return;
        }