diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-10-29 14:19:32 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-02 04:36:04 +0000 |
commit | 9da4ace1d9789d300ab298bc34694c44b2062f30 (patch) | |
tree | 0c4ce1fa4f3a97934c9504263fdfc86a28e39705 /source3/client | |
parent | 4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9 (diff) | |
download | samba-9da4ace1d9789d300ab298bc34694c44b2062f30.tar.gz samba-9da4ace1d9789d300ab298bc34694c44b2062f30.tar.bz2 samba-9da4ace1d9789d300ab298bc34694c44b2062f30.zip |
s3-debug Impove setup_logging() to specify logging to stderr
This change improves the setup_logging() API so that callers which
wish to set up logging to stderr can simply ask for it, rather than
directly modify the dbf global variable.
Andrew Bartlett
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/client.c | 12 | ||||
-rw-r--r-- | source3/client/clitar.c | 2 | ||||
-rw-r--r-- | source3/client/smbspool.c | 2 |
3 files changed, 5 insertions, 11 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 9c02879938..a7c09cf6c5 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -5046,11 +5046,8 @@ static int do_message_op(struct user_auth_info *a_info) set_global_myname( "" ); /* set default debug level to 1 regardless of what smb.conf sets */ - setup_logging( "smbclient", true ); + setup_logging( "smbclient", DEBUG_DEFAULT_STDERR ); DEBUGLEVEL_CLASS[DBGC_ALL] = 1; - if ((dbf = x_fdup(x_stderr))) { - x_setbuf( dbf, NULL ); - } load_case_tables(); @@ -5119,10 +5116,7 @@ static int do_message_op(struct user_auth_info *a_info) } break; case 'E': - if (dbf) { - x_fclose(dbf); - } - dbf = x_stderr; + setup_logging("smbclient", DEBUG_STDERR ); display_set_stderr(); break; @@ -5215,7 +5209,7 @@ static int do_message_op(struct user_auth_info *a_info) } if ( override_logfile ) - setup_logging( lp_logfile(), false ); + setup_logging( lp_logfile(), DEBUG_FILE ); if (!lp_load(get_dyn_CONFIGFILE(),true,false,false,true)) { fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n", diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 5aa59c8cff..bef53dcbbc 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1946,7 +1946,7 @@ int tar_parseargs(int argc, char *argv[], const char *Optarg, int Optind) * tar output */ if (tarhandle == 1) { - dbf = x_stderr; + setup_logging("smbclient", DEBUG_STDERR); } if (!argv[Optind]) { DEBUG(0,("Must specify tar filename\n")); diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 07de579e01..1dc548727c 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -240,7 +240,7 @@ main(int argc, /* I - Number of command-line arguments */ * Setup the SAMBA server state... */ - setup_logging("smbspool", True); + setup_logging("smbspool", DEBUG_STDOUT); lp_set_in_client(True); /* Make sure that we tell lp_load we are */ |