summaryrefslogtreecommitdiff
path: root/source3/lib/smbconf
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-04-11 14:52:52 +0200
committerMichael Adam <obnox@samba.org>2011-05-10 19:13:21 +0200
commit9f9711490ae743493722c997e316a31600ef02d6 (patch)
treea99b9b9e28f129fcf9e74e0a0d2b5b969c389e8c /source3/lib/smbconf
parente19c4f278b5467327df7a90256802382c7999414 (diff)
downloadsamba-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 'source3/lib/smbconf')
-rw-r--r--source3/lib/smbconf/smbconf_reg.c9
-rw-r--r--source3/lib/smbconf/testsuite.c28
2 files changed, 18 insertions, 19 deletions
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index f78c3555ab..deca6ec68a 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -394,7 +394,6 @@ static sbcErr smbconf_reg_get_includes_internal(TALLOC_CTX *mem_ctx,
count,
array[count]);
if (!SBC_ERROR_IS_OK(err)) {
- werr = WERR_NOMEM;
goto done;
}
}
@@ -411,6 +410,7 @@ static sbcErr smbconf_reg_get_includes_internal(TALLOC_CTX *mem_ctx,
*includes = NULL;
}
+ err = SBC_ERR_OK;
done:
talloc_free(tmp_ctx);
return err;
@@ -1071,13 +1071,12 @@ done:
return err;
}
-static WERROR smbconf_reg_get_includes(struct smbconf_ctx *ctx,
+static sbcErr smbconf_reg_get_includes(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
uint32_t *num_includes,
char ***includes)
{
- WERROR werr;
sbcErr err;
struct registry_key *key = NULL;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
@@ -1085,20 +1084,18 @@ static WERROR smbconf_reg_get_includes(struct smbconf_ctx *ctx,
err = smbconf_reg_open_service_key(tmp_ctx, ctx, service,
REG_KEY_READ, &key);
if (!SBC_ERROR_IS_OK(err)) {
- werr = WERR_NOMEM;
goto done;
}
err = smbconf_reg_get_includes_internal(mem_ctx, key, num_includes,
includes);
if (!SBC_ERROR_IS_OK(err)) {
- werr = WERR_NOMEM;
goto done;
}
done:
talloc_free(tmp_ctx);
- return werr;
+ return err;
}
static WERROR smbconf_reg_set_includes(struct smbconf_ctx *ctx,
diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c
index b52d173768..8a7e2d4c25 100644
--- a/source3/lib/smbconf/testsuite.c
+++ b/source3/lib/smbconf/testsuite.c
@@ -40,17 +40,17 @@ static void print_strings(const char *prefix,
static bool test_get_includes(struct smbconf_ctx *ctx)
{
- WERROR werr;
+ sbcErr err;
bool ret = false;
uint32_t num_includes = 0;
char **includes = NULL;
TALLOC_CTX *mem_ctx = talloc_stackframe();
printf("TEST: get_includes\n");
- werr = smbconf_get_global_includes(ctx, mem_ctx,
- &num_includes, &includes);
- if (!W_ERROR_IS_OK(werr)) {
- printf("FAIL: get_includes - %s\n", win_errstr(werr));
+ err = smbconf_get_global_includes(ctx, mem_ctx,
+ &num_includes, &includes);
+ if (!SBC_ERROR_IS_OK(err)) {
+ printf("FAIL: get_includes - %s\n", sbcErrorString(err));
goto done;
}
@@ -69,6 +69,7 @@ done:
static bool test_set_get_includes(struct smbconf_ctx *ctx)
{
WERROR werr;
+ sbcErr err;
uint32_t count;
bool ret = false;
const char *set_includes[] = {
@@ -89,11 +90,11 @@ static bool test_set_get_includes(struct smbconf_ctx *ctx)
goto done;
}
- werr = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes,
- &get_includes);
- if (!W_ERROR_IS_OK(werr)) {
+ err = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes,
+ &get_includes);
+ if (!SBC_ERROR_IS_OK(err)) {
printf("FAIL: get_set_includes (getting includes) - %s\n",
- win_errstr(werr));
+ sbcErrorString(err));
goto done;
}
@@ -126,6 +127,7 @@ done:
static bool test_delete_includes(struct smbconf_ctx *ctx)
{
WERROR werr;
+ sbcErr err;
bool ret = false;
const char *set_includes[] = {
"/path/to/include",
@@ -151,11 +153,11 @@ static bool test_delete_includes(struct smbconf_ctx *ctx)
goto done;
}
- werr = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes,
- &get_includes);
- if (!W_ERROR_IS_OK(werr)) {
+ err = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes,
+ &get_includes);
+ if (!SBC_ERROR_IS_OK(err)) {
printf("FAIL: delete_includes (getting includes) - %s\n",
- win_errstr(werr));
+ sbcErrorString(err));
goto done;
}