s3-libsmbclient Don't store 'debug_stderr' on the libsmbclient context
authorAndrew Bartlett <abartlet@samba.org>
Tue, 2 Nov 2010 04:32:16 +0000 (15:32 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 2 Nov 2010 04:36:05 +0000 (04:36 +0000)
Following the review of this patch series by Derrell Lipman, remove
the seperate storage of the debug_stderr variable from the
libsmbclient SMBC_internal_data context.

Andrew Bartlett

source3/include/libsmb_internal.h
source3/libsmb/libsmb_context.c
source3/libsmb/libsmb_setget.c

index 0bfcd8fab781922e2e095403fb9d1cf59f479915..39a32f99fb1142bdcf5fd976be4c8f09dc6643f5 100644 (file)
@@ -137,11 +137,6 @@ struct SMBC_internal_data {
         */
        SMBCFILE *                              files;
 
-        /*
-         * Log to standard error instead of the more typical standard output
-         */
-        bool                                    debug_stderr;
-
         /*
          * Support "Create Time" in get/set with the *xattr() functions, if
          * true.  This replaces the dos attribute strings C_TIME, A_TIME and
index 22e0a047172157f20a9f39a1618705409d507197..6b56e45398dca8a6feeb2eee8be40179d5d98e3d 100644 (file)
@@ -555,17 +555,6 @@ smbc_init_context(SMBCCTX *context)
                 return NULL;
         }
         
-        if (context->internal->debug_stderr) {
-            /*
-             * We do not have a unique per-thread debug state? For
-             * now, we'll just leave it up to the user. If any one
-             * context spefies debug to stderr then all will be (and
-             * will stay that way, as it is unsafe to flip back if
-             * stdout is in use for other things)
-             */
-           setup_logging("libsmbclient", DEBUG_STDERR);
-        }
-                
         if ((!smbc_getFunctionAuthData(context) &&
              !smbc_getFunctionAuthDataWithContext(context)) ||
             smbc_getDebug(context) < 0 ||
index 0d260d7cf2939038b1cd63dc195034884dfe6e5f..0a0234675251da4dce58143512e5c934cc41c374 100644 (file)
@@ -135,7 +135,16 @@ smbc_getOptionDebugToStderr(SMBCCTX *c)
 void
 smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b)
 {
-        c->internal->debug_stderr = b;
+       if (b) {
+               /*
+                * We do not have a unique per-thread debug state? For
+                * now, we'll just leave it up to the user. If any one
+                * context spefies debug to stderr then all will be (and
+                * will stay that way, as it is unsafe to flip back if
+                * stdout is in use for other things)
+                */
+               setup_logging("libsmbclient", DEBUG_STDERR);
+       }
 }
 
 /**