From 6dce5c47c62d6ad3d74489bde3824fbfb02d8616 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 1 Jun 2001 12:04:44 +0000 Subject: If a debug class was explicitly set to zero the debug system would not recognise it as there was no distinction made between zeroing a debug class and just not setting it to anything. I've added a debuglevel_isset array in parallel with the debuglevel_class array to fix this. Added a couple of new debug classes which I might start filling out to get smb, rpc header and rpc marshall/unmarshalling debugs tidied up. Fixed a bunch of cut&paste bugs in include/debug.h Modified smbcontrol and the messaging system debug handler to like the debuglevel_isset stuff. (This used to be commit 391e7caf76cbc22021629ef0ec5e0c32806edfd7) --- source3/utils/smbcontrol.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/utils/smbcontrol.c') diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 30861030d8..b940b4006a 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -180,7 +180,6 @@ static BOOL do_command(char *dest, char *msg_name, char **params) int i, n, v; int mtype; BOOL retval=False; - int debuglevel_class[DBGC_LAST]; mtype = parse_type(msg_name); if (mtype == -1) { @@ -189,19 +188,22 @@ static BOOL do_command(char *dest, char *msg_name, char **params) } switch (mtype) { - case MSG_DEBUG: + case MSG_DEBUG: { + struct debuglevel_message dm; + if (!params || !params[0]) { fprintf(stderr,"MSG_DEBUG needs a parameter\n"); return(False); } - ZERO_ARRAY(debuglevel_class); - if (!debug_parse_params(params, debuglevel_class)) { + ZERO_STRUCT(dm); + if (!debug_parse_params(params, dm.debuglevel_class, dm.debuglevel_class_isset)) { fprintf(stderr, "MSG_DEBUG error. Expected :level\n"); return(False); } else - send_message(dest, MSG_DEBUG, debuglevel_class, sizeof(debuglevel_class), False); + send_message(dest, MSG_DEBUG, &dm, sizeof(dm), False); break; + } case MSG_PROFILE: if (!params[0]) { -- cgit