Changeset 745 for trunk/server/source3/libsmb/libsmb_setget.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/libsmb/libsmb_setget.c
r414 r745 8 8 Copyright (C) Derrell Lipman 2003-2008 9 9 Copyright (C) Jeremy Allison 2007, 2008 10 10 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License as published by 13 13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 16 16 This program is distributed in the hope that it will be useful, 17 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 19 GNU General Public License for more details. 20 20 21 21 You should have received a copy of the GNU General Public License 22 22 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 91 91 smbc_setDebug(SMBCCTX *c, int debug) 92 92 { 93 char buf[32]; 94 snprintf(buf, sizeof(buf), "%d", debug); 93 95 c->debug = debug; 94 DEBUGLEVEL = debug; 96 lp_set_cmdline("log level", buf); 95 97 } 96 98 … … 119 121 smbc_getOptionDebugToStderr(SMBCCTX *c) 120 122 { 121 return c->internal->debug_stderr; 122 } 123 124 /** Set whether to log to standard error instead of standard output */ 123 /* Because this is a global concept, it is better to check 124 * what is really set, rather than what we wanted set 125 * (particularly as you cannot go back to stdout). */ 126 return debug_get_output_is_stderr(); 127 } 128 129 /** Set whether to log to standard error instead of standard output. 130 * This option is 'sticky' - once set to true, it cannot be set to 131 * false again, as it is global to the process, as once we have been 132 * told that it is not safe to safe to write to stdout, we shouldn't 133 * go back as we don't know it was this context that set it that way. 134 */ 125 135 void 126 136 smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b) 127 137 { 128 c->internal->debug_stderr = b; 138 if (b) { 139 /* 140 * We do not have a unique per-thread debug state? For 141 * now, we'll just leave it up to the user. If any one 142 * context spefies debug to stderr then all will be (and 143 * will stay that way, as it is unsafe to flip back if 144 * stdout is in use for other things) 145 */ 146 setup_logging("libsmbclient", DEBUG_STDERR); 147 } 129 148 } 130 149
Note:
See TracChangeset
for help on using the changeset viewer.