From: Mark Spencer Date: Mon, 24 May 2004 15:28:36 +0000 (+0000) Subject: Fix potential segfault, add support for MacOS X locks X-Git-Tag: 1.0.0-rc1~393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=776497fb6bf8ec1ad0fffe4c0430f98048ca123b;p=thirdparty%2Fasterisk.git Fix potential segfault, add support for MacOS X locks git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3058 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index 72743c04f5..c40a1ddcf8 100755 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -20,6 +20,14 @@ #define AST_PTHREADT_NULL (pthread_t) -1 #define AST_PTHREADT_STOP (pthread_t) -2 +#ifdef __APPLE__ +/* Provide the Linux initializers for MacOS X */ +#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE +#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP { 0x4d555458, \ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0x20 } } +#endif + #ifdef DEBUG_THREADS #ifdef THREAD_CRASH diff --git a/manager.c b/manager.c index b619baf044..c77fec158c 100755 --- a/manager.c +++ b/manager.c @@ -467,6 +467,10 @@ static int action_redirect(struct mansession *s, struct message *m) return 0; } chan = ast_get_channel_by_name_locked(name); + if (!chan) { + astman_send_error(s, m, "Channel not existant"); + return 0; + } if (strlen(name2)) chan2 = ast_get_channel_by_name_locked(name2); res = ast_async_goto(chan, context, exten, pi);