diff options
author | Andreas Schneider <asn@samba.org> | 2011-04-08 17:20:35 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-05-10 19:13:21 +0200 |
commit | 7f355e05f9ca41f9ba2bc7c9f14046a283ebd1d1 (patch) | |
tree | f7710cbcb4ee444daf7be9d5a27d2f7b8e69306a /lib | |
parent | 7af2876e4526d348a1e601f2d14776e08d4668cb (diff) | |
download | samba-7f355e05f9ca41f9ba2bc7c9f14046a283ebd1d1.tar.gz samba-7f355e05f9ca41f9ba2bc7c9f14046a283ebd1d1.tar.bz2 samba-7f355e05f9ca41f9ba2bc7c9f14046a283ebd1d1.zip |
libsmbconf: Convert smbconf_get_share() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/smbconf/smbconf.c | 11 | ||||
-rw-r--r-- | lib/smbconf/smbconf.h | 2 | ||||
-rw-r--r-- | lib/smbconf/smbconf_private.h | 2 | ||||
-rw-r--r-- | lib/smbconf/smbconf_txt.c | 15 |
4 files changed, 14 insertions, 16 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c index 68f7dfc902..e374956ca3 100644 --- a/lib/smbconf/smbconf.c +++ b/lib/smbconf/smbconf.c @@ -177,10 +177,11 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx, } for (count = 0; count < tmp_num_shares; count++) { - werr = smbconf_get_share(ctx, tmp_services, - tmp_share_names[count], - &tmp_services[count]); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_share(ctx, tmp_services, + tmp_share_names[count], + &tmp_services[count]); + if (!SBC_ERROR_IS_OK(err)) { + werr = WERR_GENERAL_FAILURE; goto done; } } @@ -236,7 +237,7 @@ sbcErr smbconf_create_share(struct smbconf_ctx *ctx, /** * get a definition of a share (service) from configuration. */ -WERROR smbconf_get_share(struct smbconf_ctx *ctx, +sbcErr smbconf_get_share(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *servicename, struct smbconf_service **service) diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h index c1a82b5cf8..93f916f0e4 100644 --- a/lib/smbconf/smbconf.h +++ b/lib/smbconf/smbconf.h @@ -85,7 +85,7 @@ sbcErr smbconf_get_share_names(struct smbconf_ctx *ctx, char ***share_names); bool smbconf_share_exists(struct smbconf_ctx *ctx, const char *servicename); sbcErr smbconf_create_share(struct smbconf_ctx *ctx, const char *servicename); -WERROR smbconf_get_share(struct smbconf_ctx *ctx, +sbcErr smbconf_get_share(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *servicename, struct smbconf_service **service); diff --git a/lib/smbconf/smbconf_private.h b/lib/smbconf/smbconf_private.h index 222497d031..d1af40bf7c 100644 --- a/lib/smbconf/smbconf_private.h +++ b/lib/smbconf/smbconf_private.h @@ -42,7 +42,7 @@ struct smbconf_ops { char ***share_names); bool (*share_exists)(struct smbconf_ctx *ctx, const char *service); sbcErr (*create_share)(struct smbconf_ctx *ctx, const char *service); - WERROR (*get_share)(struct smbconf_ctx *ctx, + sbcErr (*get_share)(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *servicename, struct smbconf_service **service); diff --git a/lib/smbconf/smbconf_txt.c b/lib/smbconf/smbconf_txt.c index 1be27e6bbd..e44abb154d 100644 --- a/lib/smbconf/smbconf_txt.c +++ b/lib/smbconf/smbconf_txt.c @@ -394,12 +394,11 @@ static sbcErr smbconf_txt_create_share(struct smbconf_ctx *ctx, /** * get a definition of a share (service) from configuration. */ -static WERROR smbconf_txt_get_share(struct smbconf_ctx *ctx, +static sbcErr smbconf_txt_get_share(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *servicename, struct smbconf_service **service) { - WERROR werr; sbcErr err; uint32_t sidx, count; bool found; @@ -408,7 +407,7 @@ static WERROR smbconf_txt_get_share(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(servicename, @@ -416,21 +415,21 @@ static WERROR smbconf_txt_get_share(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(); tmp_service = talloc_zero(tmp_ctx, struct smbconf_service); if (tmp_service == NULL) { - werr = WERR_NOMEM; + err = SBC_ERR_NOMEM; goto done; } if (servicename != NULL) { tmp_service->name = talloc_strdup(tmp_service, servicename); if (tmp_service->name == NULL) { - werr = WERR_NOMEM; + err = SBC_ERR_NOMEM; goto done; } } @@ -441,7 +440,6 @@ static WERROR smbconf_txt_get_share(struct smbconf_ctx *ctx, count, pd(ctx)->cache->param_names[sidx][count]); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } err = smbconf_add_string_to_array(tmp_service, @@ -449,7 +447,6 @@ static WERROR smbconf_txt_get_share(struct smbconf_ctx *ctx, count, pd(ctx)->cache->param_values[sidx][count]); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } } @@ -459,7 +456,7 @@ static WERROR smbconf_txt_get_share(struct smbconf_ctx *ctx, done: talloc_free(tmp_ctx); - return werr; + return err; } /** |