| 97 |
|
if (warn == 1) |
| 98 |
|
{ |
| 99 |
|
ilog(LOG_TYPE_IRCD, "Module %s unloaded", name); |
| 100 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, "Module %s unloaded", name); |
| 100 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 101 |
> |
"Module %s unloaded", name); |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
return 0; |
| 123 |
|
if (!(tmpptr = lt_dlopen(path))) { |
| 124 |
|
const char *err = ((err = lt_dlerror())) ? err : "<unknown>"; |
| 125 |
|
|
| 126 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, "Error loading module %s: %s", |
| 126 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 127 |
> |
"Error loading module %s: %s", |
| 128 |
|
mod_basename, err); |
| 129 |
|
ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err); |
| 130 |
|
return -1; |
| 134 |
|
{ |
| 135 |
|
const char *err = ((err = lt_dlerror())) ? err : "<unknown>"; |
| 136 |
|
|
| 137 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, "Error loading module %s: %s", |
| 137 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 138 |
> |
"Error loading module %s: %s", |
| 139 |
|
mod_basename, err); |
| 140 |
|
ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err); |
| 141 |
|
lt_dlclose(tmpptr); |
| 147 |
|
if (EmptyString(modp->version)) |
| 148 |
|
modp->version = unknown_ver; |
| 149 |
|
|
| 150 |
< |
DupString(modp->name, mod_basename); |
| 150 |
> |
modp->name = xstrdup(mod_basename); |
| 151 |
|
dlinkAdd(modp, &modp->node, &modules_list); |
| 152 |
|
|
| 153 |
|
if (modp->modinit) |
| 155 |
|
|
| 156 |
|
if (warn == 1) |
| 157 |
|
{ |
| 158 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 158 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 159 |
|
"Module %s [version: %s handle: %p] loaded.", |
| 160 |
|
modp->name, modp->version, tmpptr); |
| 161 |
|
ilog(LOG_TYPE_IRCD, "Module %s [version: %s handle: %p] loaded.", |
| 299 |
|
{ |
| 300 |
|
DIR *system_module_dir = NULL; |
| 301 |
|
struct dirent *ldirent = NULL; |
| 302 |
< |
char module_fq_name[PATH_MAX + 1]; |
| 302 |
> |
char module_fq_name[HYB_PATH_MAX + 1]; |
| 303 |
|
|
| 304 |
|
if ((system_module_dir = opendir(AUTOMODPATH)) == NULL) |
| 305 |
|
{ |
| 350 |
|
void |
| 351 |
|
load_core_modules(int warn) |
| 352 |
|
{ |
| 353 |
< |
char module_name[PATH_MAX + 1]; |
| 353 |
> |
char module_name[HYB_PATH_MAX + 1]; |
| 354 |
|
int i = 0; |
| 355 |
|
|
| 356 |
|
for (; core_module_table[i]; ++i) |
| 378 |
|
load_one_module(const char *path) |
| 379 |
|
{ |
| 380 |
|
dlink_node *ptr = NULL; |
| 381 |
< |
char modpath[PATH_MAX + 1]; |
| 381 |
> |
char modpath[HYB_PATH_MAX + 1]; |
| 382 |
|
struct stat statbuf; |
| 383 |
|
|
| 384 |
|
DLINK_FOREACH(ptr, mod_paths.head) |
| 397 |
|
return load_a_module(modpath, 1); |
| 398 |
|
} |
| 399 |
|
|
| 400 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 400 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 401 |
|
"Cannot locate module %s", path); |
| 402 |
|
ilog(LOG_TYPE_IRCD, "Cannot locate module %s", path); |
| 403 |
|
return -1; |