1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

param: use a single command line set_option in the code

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Garming Sam 2014-02-21 12:54:29 +13:00 committed by Jeremy Allison
parent b320953660
commit 8d4821168f

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "popt_common.h"
#include "lib/param/param.h"
/* Handle command line options:
* -d,--debuglevel
@ -99,12 +100,22 @@ static void popt_common_callback(poptContext con,
switch(opt->val) {
case OPT_OPTION:
if (!lp_set_option(arg)) {
{
struct loadparm_context *lp_ctx;
lp_ctx = loadparm_init_s3(talloc_tos(), loadparm_s3_helpers());
if (lp_ctx == NULL) {
fprintf(stderr, "loadparm_init_s3() failed!\n");
exit(1);
}
if (!lpcfg_set_option(lp_ctx, arg)) {
fprintf(stderr, "Error setting option '%s'\n", arg);
exit(1);
}
TALLOC_FREE(lp_ctx);
break;
}
case 'd':
if (arg) {
lp_set_cmdline("log level", arg);