Unix SMB/CIFS implementation.
module loading system
- Copyright (C) Jelmer Vernooij 2002-2003
+ Copyright (C) Jelmer Vernooij 2002-2004
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static struct subsystem *subsystems = NULL;
-void register_subsystem(const char *name, register_backend_function callback)
+NTSTATUS register_subsystem(const char *name, register_backend_function callback)
{
struct subsystem *s;
+ struct subsystem *t = subsystems;
+
+ while(t) {
+ if(!strcmp(name, t->name)) {
+ /* its already registered! */
+ DEBUG(0,("Subsystem '%s' already registered\n", name));
+ return NT_STATUS_OBJECT_NAME_COLLISION;
+ }
+ t = t->next;
+ }
s = smb_xmalloc(sizeof(struct subsystem));
s->prev = s->next = NULL;
DLIST_ADD(subsystems, s);
+
+ return NT_STATUS_OK;
}
NTSTATUS register_backend(const char *subsystem, void *args)