More OpenBSD patches

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Mark Spencer 22 years ago
parent 89e0dd94a2
commit a71b49f405

@ -11,6 +11,7 @@ all: $(LIB)
$(LIB): $(OBJS)
ar cr $(LIB) $(OBJS)
ranlib $(LIB)
clean:
rm -f $(LIB) *.o

@ -1,8 +1,11 @@
/*
$Log$
Revision 1.15 2003/03/16 22:37:30 matteo
dom mar 16 23:37:23 CET 2003
Revision 1.16 2003/04/23 19:13:35 markster
More OpenBSD patches
Revision 1.2 2003/04/23 19:13:35 markster
More OpenBSD patches
Revision 1.1.1.2 2003/03/16 22:37:30 matteo
dom mar 16 23:37:23 CET 2003
@ -35,7 +38,7 @@ Add broken lpc10 code... It's not too far from working I don't think...
*/
#if defined(unix)
#if defined(unix) || defined(__unix__)
typedef short INT16;
typedef int INT32;
#endif

@ -30,6 +30,10 @@
#include "asterisk.h"
#include "astconf.h"
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
static char expected_key[] =
{ 0x8e, 0x93, 0x22, 0x83, 0xf5, 0xc3, 0xc0, 0x75,
0xff, 0x8b, 0xa9, 0xbe, 0x7c, 0x43, 0x74, 0x63 };
@ -174,14 +178,20 @@ int ast_load_resource(char *resource_name)
cfg = ast_load(AST_MODULE_CONFIG);
option_verbose = o;
if (cfg) {
#ifdef RTLD_GLOBAL
if ((val = ast_variable_retrieve(cfg, "global", resource_name))
&& ast_true(val))
flags |= RTLD_GLOBAL;
#endif
ast_destroy(cfg);
}
} else {
/* Resource modules are always loaded global and lazy */
#ifdef RTLD_GLOBAL
flags = (RTLD_GLOBAL | RTLD_LAZY);
#else
flags = RTLD_LAZY;
#endif
}
if (ast_pthread_mutex_lock(&modlock))
@ -215,31 +225,43 @@ int ast_load_resource(char *resource_name)
return -1;
}
m->load_module = dlsym(m->lib, "load_module");
if (m->load_module == NULL)
m->load_module = dlsym(m->lib, "_load_module");
if (!m->load_module) {
ast_log(LOG_WARNING, "No load_module in module %s\n", fn);
errors++;
}
m->unload_module = dlsym(m->lib, "unload_module");
if (m->unload_module == NULL)
m->unload_module = dlsym(m->lib, "_unload_module");
if (!m->unload_module) {
ast_log(LOG_WARNING, "No unload_module in module %s\n", fn);
errors++;
}
m->usecount = dlsym(m->lib, "usecount");
if (m->usecount == NULL)
m->usecount = dlsym(m->lib, "_usecount");
if (!m->usecount) {
ast_log(LOG_WARNING, "No usecount in module %s\n", fn);
errors++;
}
m->description = dlsym(m->lib, "description");
if (m->description == NULL)
m->description = dlsym(m->lib, "_description");
if (!m->description) {
ast_log(LOG_WARNING, "No description in module %s\n", fn);
errors++;
}
m->key = dlsym(m->lib, "key");
if (m->key == NULL)
m->key = dlsym(m->lib, "_key");
if (!m->key) {
ast_log(LOG_WARNING, "No key routine in module %s\n", fn);
errors++;
}
m->reload = dlsym(m->lib, "reload");
if (m->reload == NULL)
m->reload = dlsym(m->lib, "_reload");
if (m->key && !(key = m->key())) {
ast_log(LOG_WARNING, "Key routine returned NULL in module %s\n", fn);
errors++;

20
pbx.c

@ -2684,7 +2684,7 @@ struct ast_context *ast_context_create(char *name, char *registrar)
/*
* errno values
* EBUSY - can't lock
* ENODATA - no existence of context
* ENOENT - no existence of context
*/
int ast_context_add_include(char *context, char *include, char *registrar)
{
@ -2710,7 +2710,7 @@ int ast_context_add_include(char *context, char *include, char *registrar)
/* we can't find the right context */
ast_unlock_contexts();
errno = ENODATA;
errno = ENOENT;
return -1;
}
@ -3035,7 +3035,7 @@ int ast_context_add_include2(struct ast_context *con, char *value,
/*
* errno values
* EBUSY - can't lock
* ENODATA - no existence of context
* ENOENT - no existence of context
*/
int ast_context_add_switch(char *context, char *sw, char *data, char *registrar)
{
@ -3061,7 +3061,7 @@ int ast_context_add_switch(char *context, char *sw, char *data, char *registrar)
/* we can't find the right context */
ast_unlock_contexts();
errno = ENODATA;
errno = ENOENT;
return -1;
}
@ -3129,7 +3129,7 @@ int ast_context_add_switch2(struct ast_context *con, char *value,
/*
* EBUSY - can't lock
* ENODATA - there is not context existence
* ENOENT - there is not context existence
*/
int ast_context_remove_ignorepat(char *context, char *ignorepat, char *registrar)
{
@ -3151,7 +3151,7 @@ int ast_context_remove_ignorepat(char *context, char *ignorepat, char *registrar
}
ast_unlock_contexts();
errno = ENODATA;
errno = ENOENT;
return -1;
}
@ -3188,7 +3188,7 @@ int ast_context_remove_ignorepat2(struct ast_context *con, char *ignorepat, char
/*
* EBUSY - can't lock
* ENODATA - there is no existence of context
* ENOENT - there is no existence of context
*/
int ast_context_add_ignorepat(char *con, char *value, char *registrar)
{
@ -3210,7 +3210,7 @@ int ast_context_add_ignorepat(char *con, char *value, char *registrar)
}
ast_unlock_contexts();
errno = ENODATA;
errno = ENOENT;
return -1;
}
@ -3266,7 +3266,7 @@ int ast_ignore_pattern(char *context, char *pattern)
/*
* EBUSY - can't lock
* ENODATA - no existence of context
* ENOENT - no existence of context
*
*/
int ast_add_extension(char *context, int replace, char *extension, int priority, char *callerid,
@ -3291,7 +3291,7 @@ int ast_add_extension(char *context, int replace, char *extension, int priority,
}
ast_unlock_contexts();
errno = ENODATA;
errno = ENOENT;
return -1;
}

@ -689,10 +689,10 @@ static int handle_context_add_include(int fd, int argc, char *argv[])
ast_cli(fd, "Context '%s' already included in '%s' context\n",
argv[1], argv[3]); break;
case ENODATA:
case ENOENT:
case EINVAL:
ast_cli(fd, "There is no existence of context '%s'\n",
errno == ENODATA ? argv[3] : argv[1]); break;
errno == ENOENT ? argv[3] : argv[1]); break;
default:
ast_cli(fd, "Failed to include '%s' in '%s' context\n",
@ -1115,7 +1115,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
case EBUSY:
ast_cli(fd, "Failed to lock context(s) list, please try again later\n"); break;
case ENODATA:
case ENOENT:
ast_cli(fd, "No existence of '%s' context\n", argv[4]); break;
case EEXIST:
@ -1197,7 +1197,7 @@ static int handle_context_add_ignorepat(int fd, int argc, char *argv[])
case ENOMEM:
ast_cli(fd, "Out of free memory\n"); break;
case ENODATA:
case ENOENT:
ast_cli(fd, "There is no existence of '%s' context\n", argv[4]);
break;
@ -1294,7 +1294,7 @@ static int handle_context_remove_ignorepat(int fd, int argc, char *argv[])
ast_cli(fd, "Failed to lock context(s) list, please try again later\n");
break;
case ENODATA:
case ENOENT:
ast_cli(fd, "There is no existence of '%s' context\n", argv[4]);
break;

Loading…
Cancel
Save