All future assignments of the debug level should go via
lp_set_cmdline("log level", "x") because this will ensure the value is
not overwritten in an smb.conf load.
Andrew Bartlett
void
smbc_setDebug(SMBCCTX *c, int debug)
{
+ char buf[32];
+ snprintf(buf, sizeof(buf), "%d", debug);
c->debug = debug;
- DEBUGLEVEL = debug;
+ lp_set_cmdline("log level", buf);
}
/**
}
if (argc == 2) {
- DEBUGLEVEL = atoi(argv[1]);
+ lp_set_cmdline("log level", argv[1]);
}
printf("debuglevel is %d\n", DEBUGLEVEL);
NumLoops = atoi(optarg);
break;
case 'd':
- DEBUGLEVEL = atoi(optarg);
+ lp_set_cmdline("log level", optarg);
break;
case 'E':
die_on_error = 1;
torture_numops = atoi(optarg);
break;
case 'd':
- DEBUGLEVEL = atoi(optarg);
+ lp_set_cmdline("log level", optarg);
break;
case 'O':
sockops = optarg;
}
if (argc == 2) {
- DEBUGLEVEL = atoi(argv[1]);
+ lp_set_cmdline("log level", argv[1]);
}
printf("debuglevel is %d\n", DEBUGLEVEL);
lp_set_name_resolve_order(optarg);
break;
case 'D':
- DEBUGLEVEL = atoi(optarg);
+ lp_set_cmdline("log level", optarg);
break;
case 'U': {
got_username = True;