summaryrefslogtreecommitdiff
path: root/source3/lib/iconv.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2003-04-28 17:48:48 +0000
committerJelmer Vernooij <jelmer@samba.org>2003-04-28 17:48:48 +0000
commit17a3acafa89bfc6090b0767d05a00a7505003fcc (patch)
tree8c1ddf10d38ef69a9e72a009d6dc890e5bbe901c /source3/lib/iconv.c
parentcff01c538f3647f5169a8e5a3ab4b77ad0cebce5 (diff)
downloadsamba-17a3acafa89bfc6090b0767d05a00a7505003fcc.tar.gz
samba-17a3acafa89bfc6090b0767d05a00a7505003fcc.tar.bz2
samba-17a3acafa89bfc6090b0767d05a00a7505003fcc.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 bc4b51bcb2daa7271c884cb83bf8bdba6d3a9b6d)
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 01fa31915a..c09bff5fd7 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