diff options
author | Derrell Lipman <derrell@samba.org> | 2005-12-29 16:26:06 +0000 |
---|---|---|
committer | Derrell Lipman <derrell@samba.org> | 2005-12-29 16:26:06 +0000 |
commit | 997a09dff8148d52ee522583e27ccfa01a06c8c3 (patch) | |
tree | ea2672e0043048251206e38ce9eb7cd216d3e827 /source/libsmb/libsmbclient.c | |
parent | d2d7950291be08ef5dc3b6fee77f65f4c647c06d (diff) | |
download | samba-997a09dff8148d52ee522583e27ccfa01a06c8c3.tar.gz samba-997a09dff8148d52ee522583e27ccfa01a06c8c3.tar.xz samba-997a09dff8148d52ee522583e27ccfa01a06c8c3.zip |
r12576: r12115@cabra: derrell | 2005-12-29 11:16:03 -0500
bug (enhancement) #2651: add option to log debug messages to stderr instead of stdout
Diffstat (limited to 'source/libsmb/libsmbclient.c')
-rw-r--r-- | source/libsmb/libsmbclient.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c index 8cfef769e57..6eca3946d8f 100644 --- a/source/libsmb/libsmbclient.c +++ b/source/libsmb/libsmbclient.c @@ -5938,6 +5938,27 @@ smbc_free_context(SMBCCTX *context, /* + * Each time the context structure is changed, we have binary backward + * compatibility issues. Instead of modifying the public portions of the + * context structure to add new options, instead, we put them in the internal + * portion of the context structure and provide a set function for these new + * options. + */ +void +smbc_option_set(SMBCCTX *context, + char *option_name, + void *option_value) +{ + if (strcmp(option_name, "debug_stderr") == 0) { + /* + * Log to standard error instead of standard output. + */ + context->internal->_debug_stderr = True; + } +} + + +/* * Initialise the library etc * * We accept a struct containing handle information. @@ -5982,7 +6003,12 @@ smbc_init_context(SMBCCTX *context) DEBUGLEVEL = context->debug; load_case_tables(); - setup_logging( "libsmbclient", True); + + setup_logging("libsmbclient", True); + if (context->internal->_debug_stderr) { + dbf = x_stderr; + x_setbuf(x_stderr, NULL); + } /* Here we would open the smb.conf file if needed ... */ @@ -6099,7 +6125,7 @@ smbc_init_context(SMBCCTX *context) * FIXME: Should we check the function pointers here? */ - context->internal->_initialized = 1; + context->internal->_initialized = True; return context; } |