diff options
author | Andreas Schneider <asn@samba.org> | 2011-04-11 14:52:52 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-05-10 19:13:21 +0200 |
commit | 9f9711490ae743493722c997e316a31600ef02d6 (patch) | |
tree | a99b9b9e28f129fcf9e74e0a0d2b5b969c389e8c /lib/smbconf | |
parent | e19c4f278b5467327df7a90256802382c7999414 (diff) | |
download | samba-9f9711490ae743493722c997e316a31600ef02d6.tar.gz samba-9f9711490ae743493722c997e316a31600ef02d6.tar.bz2 samba-9f9711490ae743493722c997e316a31600ef02d6.zip |
libsmbconf: Convert smbconf_get_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/smbconf')
-rw-r--r-- | lib/smbconf/smbconf.c | 13 | ||||
-rw-r--r-- | lib/smbconf/smbconf.h | 4 | ||||
-rw-r--r-- | lib/smbconf/smbconf_private.h | 2 | ||||
-rw-r--r-- | lib/smbconf/smbconf_txt.c | 14 |
4 files changed, 15 insertions, 18 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c index a6bb64fec8..f23a802e7c 100644 --- a/lib/smbconf/smbconf.c +++ b/lib/smbconf/smbconf.c @@ -355,7 +355,7 @@ sbcErr smbconf_delete_global_parameter(struct smbconf_ctx *ctx, return err; } -WERROR smbconf_get_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes) @@ -364,21 +364,20 @@ WERROR smbconf_get_includes(struct smbconf_ctx *ctx, includes); } -WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_global_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, uint32_t *num_includes, char ***includes) { - WERROR werr; sbcErr err; err = smbconf_global_check(ctx); - if (SBC_ERROR_IS_OK(err)) { - return WERR_GENERAL_FAILURE; + if (!SBC_ERROR_IS_OK(err)) { + return err; } - werr = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME, + err = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME, num_includes, includes); - return werr; + return err; } WERROR smbconf_set_includes(struct smbconf_ctx *ctx, diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h index e0a3ed5054..672c256480 100644 --- a/lib/smbconf/smbconf.h +++ b/lib/smbconf/smbconf.h @@ -111,11 +111,11 @@ sbcErr smbconf_delete_parameter(struct smbconf_ctx *ctx, const char *service, const char *param); sbcErr smbconf_delete_global_parameter(struct smbconf_ctx *ctx, const char *param); -WERROR smbconf_get_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes); -WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_global_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, uint32_t *num_includes, char ***includes); WERROR smbconf_set_includes(struct smbconf_ctx *ctx, diff --git a/lib/smbconf/smbconf_private.h b/lib/smbconf/smbconf_private.h index c46d30279b..8fb9c84921 100644 --- a/lib/smbconf/smbconf_private.h +++ b/lib/smbconf/smbconf_private.h @@ -59,7 +59,7 @@ struct smbconf_ops { char **valstr); sbcErr (*delete_parameter)(struct smbconf_ctx *ctx, const char *service, const char *param); - WERROR (*get_includes)(struct smbconf_ctx *ctx, + sbcErr (*get_includes)(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes); diff --git a/lib/smbconf/smbconf_txt.c b/lib/smbconf/smbconf_txt.c index 17dee486d5..7983d925e6 100644 --- a/lib/smbconf/smbconf_txt.c +++ b/lib/smbconf/smbconf_txt.c @@ -533,13 +533,12 @@ static sbcErr smbconf_txt_delete_parameter(struct smbconf_ctx *ctx, return SBC_ERR_NOT_SUPPORTED; } -static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, +static sbcErr smbconf_txt_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes) { - WERROR werr; sbcErr err; bool found; uint32_t sidx, count; @@ -549,7 +548,7 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, err = smbconf_txt_load_file(ctx); if (!SBC_ERROR_IS_OK(err)) { - return WERR_GENERAL_FAILURE; + return err; } found = smbconf_find_in_array(service, @@ -557,7 +556,7 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, pd(ctx)->cache->num_shares, &sidx); if (!found) { - return WERR_NO_SUCH_SERVICE; + return SBC_ERR_NO_SUCH_SERVICE; } tmp_ctx = talloc_stackframe(); @@ -571,7 +570,6 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, tmp_num_includes, pd(ctx)->cache->param_values[sidx][count]); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } tmp_num_includes++; @@ -582,18 +580,18 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, if (*num_includes > 0) { *includes = talloc_move(mem_ctx, &tmp_includes); if (*includes == NULL) { - werr = WERR_NOMEM; + err = SBC_ERR_NOMEM; goto done; } } else { *includes = NULL; } - werr = WERR_OK; + err = SBC_ERR_OK; done: talloc_free(tmp_ctx); - return werr; + return err; } static WERROR smbconf_txt_set_includes(struct smbconf_ctx *ctx, |