summaryrefslogtreecommitdiff
path: root/source3/lib/iconv.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2003-04-28 18:33:25 +0000
committerJelmer Vernooij <jelmer@samba.org>2003-04-28 18:33:25 +0000
commit81256ecbb977351b4d6a992df17be4b107071935 (patch)
treeb299293b39b94c7c4fb9eb8f7ffc179aad46a03d /source3/lib/iconv.c
parent023cd5ff70083526423320470c41eefef1b8f93f (diff)
downloadsamba-81256ecbb977351b4d6a992df17be4b107071935.tar.gz
samba-81256ecbb977351b4d6a992df17be4b107071935.tar.bz2
samba-81256ecbb977351b4d6a992df17be4b107071935.zip
Use NTSTATUS as return value for smb_register_*() functions and init_module()
function. Patch by metze with some minor modifications. (This used to be commit f4576757d1d52a8f1b96894c869bb76450003fd1)
Diffstat (limited to 'source3/lib/iconv.c')
-rw-r--r--source3/lib/iconv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/lib/iconv.c b/source3/lib/iconv.c
index a5fcf32b5b..d9160f0d01 100644
--- a/source3/lib/iconv.c
+++ b/source3/lib/iconv.c
@@ -77,22 +77,23 @@ static struct charset_functions *find_charset_functions(const char *name)
return NULL;
}
-BOOL smb_register_charset(struct charset_functions *funcs)
+NTSTATUS smb_register_charset(struct charset_functions *funcs)
{
- struct charset_functions *c = charsets;
+ if (!funcs) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
DEBUG(5, ("Attempting to register new charset %s\n", funcs->name));
/* Check whether we already have this charset... */
-
if (find_charset_functions(funcs->name)) {
DEBUG(0, ("Duplicate charset %s, not registering\n", funcs->name));
- return False;
+ return NT_STATUS_OBJECT_NAME_COLLISION;
}
funcs->next = funcs->prev = NULL;
DEBUG(5, ("Registered charset %s\n", funcs->name));
DLIST_ADD(charsets, funcs);
- return True;
+ return NT_STATUS_OK;
}
void lazy_initialize_iconv(void)
@@ -219,14 +220,14 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode)
#endif
/* check if there is a module available that can do this conversion */
- if (!ret->pull && smb_probe_module("charset", fromcode)) {
+ if (!ret->pull && NT_STATUS_IS_OK(smb_probe_module("charset", fromcode))) {
if(!(from = find_charset_functions(fromcode)))
DEBUG(0, ("Module %s doesn't provide charset %s!\n", fromcode, fromcode));
else
ret->pull = from->pull;
}
- if (!ret->push && smb_probe_module("charset", tocode)) {
+ if (!ret->push && NT_STATUS_IS_OK(smb_probe_module("charset", tocode))) {
if(!(to = find_charset_functions(tocode)))
DEBUG(0, ("Module %s doesn't provide charset %s!\n", tocode, tocode));
else