"idmap", /* DBGC_IDMAP */
"quota", /* DBGC_QUOTA */
"acls", /* DBGC_ACLS */
+ "locking", /* DBGC_LOCKING */
+ "msdfs", /* DBGC_MSDFS */
+ "dmapi", /* DBGC_DMAPI */
NULL
};
* Functions...
*/
+/***************************************************************************
+ Free memory pointed to by global pointers.
+****************************************************************************/
+
+void gfree_debugsyms(void)
+{
+ int i;
+
+ if ( classname_table ) {
+ for ( i = 0; i < debug_num_classes; i++ ) {
+ SAFE_FREE( classname_table[i] );
+ }
+ SAFE_FREE( classname_table );
+ }
+
+ if ( DEBUGLEVEL_CLASS != &debug_all_class_hack )
+ SAFE_FREE( DEBUGLEVEL_CLASS );
+
+ if ( DEBUGLEVEL_CLASS_ISSET != &debug_all_class_isset_hack )
+ SAFE_FREE( DEBUGLEVEL_CLASS_ISSET );
+}
/****************************************************************************
utility lists registered debug class names's
char *b;
BOOL err = False;
- if (DEBUGLEVEL_CLASS == &debug_all_class_hack)
+ if (DEBUGLEVEL_CLASS == &debug_all_class_hack) {
return NULL;
+ }
list = SMB_CALLOC_ARRAY(char *, debug_num_classes + 1);
- if (!list)
+ if (!list) {
return NULL;
+ }
/* prepare strings */
for (i = 0, dim = 0; i < debug_num_classes; i++) {
done:
/* free strings list */
- for (i = 0; i < debug_num_classes; i++)
- if (list[i]) free(list[i]);
- free(list);
+ for (i = 0; i < debug_num_classes; i++) {
+ SAFE_FREE(list[i]);
+ }
+ SAFE_FREE(list);
if (err) {
- if (buf)
- free(buf);
return NULL;
} else {
return buf;
Receive a "set debug level" message.
****************************************************************************/
-static void debug_message(int msg_type, pid_t src, void *buf, size_t len)
+static void debug_message(int msg_type, struct process_id src,
+ void *buf, size_t len)
{
const char *params_str = buf;
/* Check, it's a proper string! */
if (params_str[len-1] != '\0') {
DEBUG(1, ("Invalid debug message from pid %u to pid %u\n",
- (unsigned int)src, (unsigned int)getpid()));
+ (unsigned int)procid_to_pid(&src),
+ (unsigned int)getpid()));
return;
}
DEBUG(3, ("INFO: Remote set of debug to `%s' (pid %u from pid %u)\n",
- params_str, (unsigned int)getpid(), (unsigned int)src));
+ params_str, (unsigned int)getpid(),
+ (unsigned int)procid_to_pid(&src)));
debug_parse_levels(params_str);
}
{
if (!params_str)
return;
- message_send_pid(pid, MSG_DEBUG, params_str, strlen(params_str) + 1,
+ message_send_pid(pid_to_procid(pid), MSG_DEBUG,
+ params_str, strlen(params_str) + 1,
False);
}
Return current debug level.
****************************************************************************/
-static void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len)
+static void debuglevel_message(int msg_type, struct process_id src,
+ void *buf, size_t len)
{
char *message = debug_list_class_names_and_levels();
- DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src));
+ if (!message) {
+ DEBUG(0,("debuglevel_message - debug_list_class_names_and_levels returned NULL\n"));
+ return;
+ }
+
+ DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",
+ (unsigned int)procid_to_pid(&src)));
message_send_pid(src, MSG_DEBUGLEVEL, message, strlen(message) + 1, True);
SAFE_FREE(message);
if (initialised)
return;
-
+
initialised = True;
message_register(MSG_DEBUG, debug_message);
/* Print it all out at once to prevent split syslog output. */
(void)Debug1( "[%s, %d%s] %s:%s(%d)\n",
- timestring(lp_debug_hires_timestamp()), level,
+ current_timestring(lp_debug_hires_timestamp()), level,
header_str, file, func, line );
}