Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/libsmb/libsmb_setget.c

    r414 r745  
    88   Copyright (C) Derrell Lipman 2003-2008
    99   Copyright (C) Jeremy Allison 2007, 2008
    10    
     10
    1111   This program is free software; you can redistribute it and/or modify
    1212   it under the terms of the GNU General Public License as published by
    1313   the Free Software Foundation; either version 3 of the License, or
    1414   (at your option) any later version.
    15    
     15
    1616   This program is distributed in the hope that it will be useful,
    1717   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1818   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1919   GNU General Public License for more details.
    20    
     20
    2121   You should have received a copy of the GNU General Public License
    2222   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    9191smbc_setDebug(SMBCCTX *c, int debug)
    9292{
     93        char buf[32];
     94        snprintf(buf, sizeof(buf), "%d", debug);
    9395        c->debug = debug;
    94         DEBUGLEVEL = debug;
     96        lp_set_cmdline("log level", buf);
    9597}
    9698
     
    119121smbc_getOptionDebugToStderr(SMBCCTX *c)
    120122{
    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 */
    125135void
    126136smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b)
    127137{
    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        }
    129148}
    130149
Note: See TracChangeset for help on using the changeset viewer.