diff options
author | Andrew Bartlett <abartlet@samba.org> | 2014-01-27 15:32:39 +1300 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-05-07 19:49:17 +0200 |
commit | 3d6a0270e45d45aae6fb0249efce7e640bc66097 (patch) | |
tree | d923eb68d759235ede0cea6d260027f7bcb9d302 /lib | |
parent | 412a387357a1d988c3d35064acc83449c44ac16b (diff) | |
download | samba-3d6a0270e45d45aae6fb0249efce7e640bc66097.tar.gz samba-3d6a0270e45d45aae6fb0249efce7e640bc66097.tar.xz samba-3d6a0270e45d45aae6fb0249efce7e640bc66097.zip |
lib/param: Make and use lpcfg_dump_a_service() in common
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/param/loadparm.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index bf3b09486ce..cf943261fe1 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -1949,8 +1949,8 @@ static void dump_globals(struct loadparm_context *lp_ctx, FILE *f, * Display the contents of a single services record. */ -static void dump_a_service(struct loadparm_service * pService, struct loadparm_service *sDefault, FILE * f, - unsigned int *flags) +void lpcfg_dump_a_service(struct loadparm_service * pService, struct loadparm_service *sDefault, FILE * f, + unsigned int *flags, bool show_defaults) { int i; struct parmlist_entry *data; @@ -1967,7 +1967,7 @@ static void dump_a_service(struct loadparm_service * pService, struct loadparm_s if (flags && (flags[i] & FLAG_DEFAULT)) { continue; } - if (defaults_saved) { + if (!show_defaults) { if (is_default(sDefault, i)) { continue; } @@ -2711,11 +2711,9 @@ void lpcfg_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults, return; } - defaults_saved = !show_defaults; - dump_globals(lp_ctx, f, show_defaults); - dump_a_service(lp_ctx->sDefault, lp_ctx->sDefault, f, lp_ctx->flags); + lpcfg_dump_a_service(lp_ctx->sDefault, lp_ctx->sDefault, f, lp_ctx->flags, show_defaults); for (iService = 0; iService < maxtoprint; iService++) lpcfg_dump_one(f, show_defaults, lp_ctx->services[iService], lp_ctx->sDefault); @@ -2729,7 +2727,7 @@ void lpcfg_dump_one(FILE *f, bool show_defaults, struct loadparm_service *servic if (service != NULL) { if (service->szService[0] == '\0') return; - dump_a_service(service, sDefault, f, NULL); + lpcfg_dump_a_service(service, sDefault, f, NULL, show_defaults); } } |