summaryrefslogtreecommitdiff
path: root/lib/smbconf
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-04-11 17:43:10 +0200
committerMichael Adam <obnox@samba.org>2011-05-10 19:13:22 +0200
commit4d391d29f87cfe88e1d3aa96f193c486beb5a1f1 (patch)
tree07c6362725b61ac2b7bd991c8a9382ae05902d12 /lib/smbconf
parente1f0b91c5fd6b11e258464994868be8020c89e89 (diff)
downloadsamba-4d391d29f87cfe88e1d3aa96f193c486beb5a1f1.tar.gz
libsmbconf: Convert smbconf_get_config() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/smbconf')
-rw-r--r--lib/smbconf/smbconf.c14
-rw-r--r--lib/smbconf/smbconf.h2
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c
index c81af36cdbd..e0441ed9857 100644
--- a/lib/smbconf/smbconf.c
+++ b/lib/smbconf/smbconf.c
@@ -141,12 +141,11 @@ sbcErr smbconf_drop(struct smbconf_ctx *ctx)
* param_names : list of lists of parameter names for each share
* param_values : list of lists of parameter values for each share
*/
-WERROR smbconf_get_config(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_config(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
uint32_t *num_shares,
struct smbconf_service ***services)
{
- WERROR werr = WERR_OK;
sbcErr err;
TALLOC_CTX *tmp_ctx = NULL;
uint32_t tmp_num_shares;
@@ -155,7 +154,7 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
uint32_t count;
if ((num_shares == NULL) || (services == NULL)) {
- werr = WERR_INVALID_PARAM;
+ err = SBC_ERR_INVALID_PARAM;
goto done;
}
@@ -164,15 +163,13 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
err = smbconf_get_share_names(ctx, tmp_ctx, &tmp_num_shares,
&tmp_share_names);
if (!SBC_ERROR_IS_OK(err)) {
- werr = WERR_GENERAL_FAILURE;
goto done;
}
tmp_services = talloc_array(tmp_ctx, struct smbconf_service *,
tmp_num_shares);
-
if (tmp_services == NULL) {
- werr = WERR_NOMEM;
+ err = SBC_ERR_NOMEM;
goto done;
}
@@ -181,12 +178,11 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
tmp_share_names[count],
&tmp_services[count]);
if (!SBC_ERROR_IS_OK(err)) {
- werr = WERR_GENERAL_FAILURE;
goto done;
}
}
- werr = WERR_OK;
+ err = SBC_ERR_OK;
*num_shares = tmp_num_shares;
if (tmp_num_shares > 0) {
@@ -197,7 +193,7 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
done:
talloc_free(tmp_ctx);
- return werr;
+ return err;
}
/**
diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h
index f5dd922ed16..467b5caa795 100644
--- a/lib/smbconf/smbconf.h
+++ b/lib/smbconf/smbconf.h
@@ -76,7 +76,7 @@ void smbconf_shutdown(struct smbconf_ctx *ctx);
bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
const char *service, const char *param);
sbcErr smbconf_drop(struct smbconf_ctx *ctx);
-WERROR smbconf_get_config(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_config(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
uint32_t *num_shares,
struct smbconf_service ***services);