ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/modules.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/modules.c (file contents):
Revision 1592 by michael, Sat Oct 27 21:02:32 2012 UTC vs.
Revision 1997 by michael, Sat May 11 17:35:07 2013 UTC

# Line 41 | Line 41
41  
42   dlink_list modules_list = { NULL, NULL, 0 };
43  
44 < static const char *unknown_ver = "<unknown>";
44 > static dlink_list mod_paths = { NULL, NULL, 0 };
45 > static dlink_list conf_modules = { NULL, NULL, 0 };
46  
47 + static const char *unknown_ver = "<unknown>";
48   static const char *core_module_table[] =
49   {
50    "m_die.la",
# Line 61 | Line 63 | static const char *core_module_table[] =
63    NULL
64   };
65  
64 static dlink_list mod_paths = { NULL, NULL, 0 };
65 static dlink_list conf_modules = { NULL, NULL, 0 };
66
66   int
67   modules_valid_suffix(const char *name)
68   {
# Line 97 | Line 96 | unload_one_module(const char *name, int
96    if (warn == 1)
97    {
98      ilog(LOG_TYPE_IRCD, "Module %s unloaded", name);
99 <    sendto_realops_flags(UMODE_ALL, L_ALL, "Module %s unloaded", name);
99 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
100 >                         "Module %s unloaded", name);
101    }
102  
103    return 0;
# Line 122 | Line 122 | load_a_module(const char *path, int warn
122    if (!(tmpptr = lt_dlopen(path))) {
123      const char *err = ((err = lt_dlerror())) ? err : "<unknown>";
124  
125 <    sendto_realops_flags(UMODE_ALL, L_ALL, "Error loading module %s: %s",
125 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
126 >                         "Error loading module %s: %s",
127                           mod_basename, err);
128      ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err);
129      return -1;
# Line 132 | Line 133 | load_a_module(const char *path, int warn
133    {
134      const char *err = ((err = lt_dlerror())) ? err : "<unknown>";
135  
136 <    sendto_realops_flags(UMODE_ALL, L_ALL, "Error loading module %s: %s",
136 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
137 >                         "Error loading module %s: %s",
138                           mod_basename, err);
139      ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err);
140      lt_dlclose(tmpptr);
# Line 144 | Line 146 | load_a_module(const char *path, int warn
146    if (EmptyString(modp->version))
147      modp->version = unknown_ver;
148  
149 <  DupString(modp->name, mod_basename);
149 >  modp->name = xstrdup(mod_basename);
150    dlinkAdd(modp, &modp->node, &modules_list);
151  
152    if (modp->modinit)
# Line 152 | Line 154 | load_a_module(const char *path, int warn
154  
155    if (warn == 1)
156    {
157 <    sendto_realops_flags(UMODE_ALL, L_ALL,
157 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
158                           "Module %s [version: %s handle: %p] loaded.",
159                           modp->name, modp->version, tmpptr);
160      ilog(LOG_TYPE_IRCD, "Module %s [version: %s handle: %p] loaded.",
# Line 296 | Line 298 | load_all_modules(int warn)
298   {
299    DIR *system_module_dir = NULL;
300    struct dirent *ldirent = NULL;
301 <  char module_fq_name[PATH_MAX + 1];
301 >  char module_fq_name[HYB_PATH_MAX + 1];
302  
303    if ((system_module_dir = opendir(AUTOMODPATH)) == NULL)
304    {
# Line 347 | Line 349 | load_conf_modules(void)
349   void
350   load_core_modules(int warn)
351   {
352 <  char module_name[PATH_MAX + 1];
352 >  char module_name[HYB_PATH_MAX + 1];
353    int i = 0;
354  
355    for (; core_module_table[i]; ++i)
# Line 375 | Line 377 | int
377   load_one_module(const char *path)
378   {
379    dlink_node *ptr = NULL;
380 <  char modpath[PATH_MAX + 1];
380 >  char modpath[HYB_PATH_MAX + 1];
381    struct stat statbuf;
382  
383    DLINK_FOREACH(ptr, mod_paths.head)
# Line 394 | Line 396 | load_one_module(const char *path)
396            return load_a_module(modpath, 1);
397    }
398  
399 <  sendto_realops_flags(UMODE_ALL, L_ALL,
399 >  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
400                         "Cannot locate module %s", path);
401    ilog(LOG_TYPE_IRCD, "Cannot locate module %s", path);
402    return -1;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)