summaryrefslogtreecommitdiff
path: root/source3/utils/net_conf.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-09 14:59:05 +0200
committerMichael Adam <obnox@samba.org>2008-04-10 01:29:02 +0200
commit52a16b4945e68dc4a0d0c762e0019b554469ae75 (patch)
tree825ee6f72f38997216c90e02295efb51b1a2e708 /source3/utils/net_conf.c
parent2a94369946a896e12d6527a299f39c265d8dbaa2 (diff)
downloadsamba-52a16b4945e68dc4a0d0c762e0019b554469ae75.tar.gz
samba-52a16b4945e68dc4a0d0c762e0019b554469ae75.tar.bz2
samba-52a16b4945e68dc4a0d0c762e0019b554469ae75.zip
net conf: reduce indentation by grouping testmode code together.
Michael (This used to be commit 97f9cb857532328999589062ceb0b229bcaf93a3)
Diffstat (limited to 'source3/utils/net_conf.c')
-rw-r--r--source3/utils/net_conf.c76
1 files changed, 37 insertions, 39 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index f74ba98f54..575bfb89ca 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -133,57 +133,55 @@ static WERROR import_process_service(struct smbconf_ctx *conf_ctx,
if (opt_testmode) {
d_printf("[%s]\n", servicename);
- } else {
- if (smbconf_share_exists(conf_ctx, servicename)) {
- werr = smbconf_delete_share(conf_ctx, servicename);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
+ for (idx = 0; idx < num_params; idx ++) {
+ d_printf("\t%s = %s\n", param_names[idx],
+ param_values[idx]);
}
- werr = smbconf_create_share(conf_ctx, servicename);
+ d_printf("\n");
+ goto done;
+ }
+
+ if (smbconf_share_exists(conf_ctx, servicename)) {
+ werr = smbconf_delete_share(conf_ctx, servicename);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
}
+ werr = smbconf_create_share(conf_ctx, servicename);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
for (idx = 0; idx < num_params; idx ++) {
- if (opt_testmode) {
- d_printf("\t%s = %s\n", param_names[idx],
- param_values[idx]);
+ if (strequal(param_names[idx], "include")) {
+ includes = TALLOC_REALLOC_ARRAY(mem_ctx,
+ includes,
+ char *,
+ num_includes+1);
+ if (includes == NULL) {
+ werr = WERR_NOMEM;
+ goto done;
+ }
+ includes[num_includes] = talloc_strdup(includes,
+ param_values[idx]);
+ if (includes[num_includes] == NULL) {
+ werr = WERR_NOMEM;
+ goto done;
+ }
+ num_includes++;
} else {
- if (strequal(param_names[idx], "include")) {
- includes = TALLOC_REALLOC_ARRAY(mem_ctx,
- includes,
- char *,
- num_includes+1);
- if (includes == NULL) {
- werr = WERR_NOMEM;
- goto done;
- }
- includes[num_includes] =
- talloc_strdup(includes,
- param_values[idx]);
- if (includes[num_includes] == NULL) {
- werr = WERR_NOMEM;
- goto done;
- }
- num_includes++;
- } else {
- werr = smbconf_set_parameter(conf_ctx,
- servicename,
- param_names[idx],
- param_values[idx]);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
+ werr = smbconf_set_parameter(conf_ctx,
+ servicename,
+ param_names[idx],
+ param_values[idx]);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
}
}
}
- if (!opt_testmode) {
- werr = smbconf_set_includes(conf_ctx, servicename, num_includes,
- (const char **)includes);
- }
+ werr = smbconf_set_includes(conf_ctx, servicename, num_includes,
+ (const char **)includes);
done:
TALLOC_FREE(mem_ctx);