diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-09-08 16:48:07 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-09-08 16:48:07 +0000 |
commit | 2be6d9d7c174007ac0018fed802364d2115f0283 (patch) | |
tree | 32674bc8c5dc21153e7c8a4548f6641aef0566bf /channels | |
parent | ee8cba2208114438d40442616149adf12cc422c2 (diff) |
BSD portability enhancements (bug #234)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1486 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_agent.c | 2 | ||||
-rwxr-xr-x | channels/chan_iax2.c | 4 | ||||
-rwxr-xr-x | channels/chan_mgcp.c | 4 | ||||
-rwxr-xr-x | channels/chan_modem.c | 11 | ||||
-rwxr-xr-x | channels/chan_sip.c | 4 |
5 files changed, 15 insertions, 10 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index d293f9cc1..7421f5d53 100755 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -194,7 +194,7 @@ static struct agent_pvt *add_agent(char *agent, int pending) strncpy(p->agent, tmp, sizeof(p->agent) -1); ast_mutex_init( &p->lock ); ast_mutex_init( &p->app_lock ); - p->owning_app = -1; + p->owning_app = (pthread_t) -1; p->app_sleep_cond = 1; p->group = group; p->pending = pending; diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 71c5056bd..76957798d 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3576,7 +3576,9 @@ static int timing_read(int *id, int fd, short events, void *cbdata) struct iax2_peer *peer; int processed = 0; int totalcalls = 0; +#ifdef ZT_TIMERACK int x = 1; +#endif if (iaxtrunkdebug) ast_verbose("Beginning trunk processing\n"); if (events & AST_IO_PRI) { @@ -5116,7 +5118,9 @@ static int set_config(char *config_file, struct sockaddr_in* sin){ int format; struct iax2_user *user; struct iax2_peer *peer; +#if 0 static unsigned short int last_port=0; +#endif cfg = ast_load(config_file); diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 1e40d5a73..5871d0449 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -413,7 +413,7 @@ static int mgcp_postrequest(struct mgcp_subchannel *sub, unsigned char *data, in time(&t); if (sub->messagepending && (sub->lastouttime + 20 < t)) { ast_log(LOG_NOTICE, "Timeout waiting for response to message:%d, lastouttime: %ld, now: %ld. Dumping pending queue\n", - sub->msgs ? sub->msgs->seqno : -1, sub->lastouttime, t); + sub->msgs ? sub->msgs->seqno : -1, (long) sub->lastouttime, (long) t); dump_queue(sub->parent); } msg->seqno = seqno; @@ -2546,7 +2546,7 @@ static void *do_monitor(void *data) static int restart_monitor(void) { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == -2) + if (monitor_thread == (pthread_t) -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); diff --git a/channels/chan_modem.c b/channels/chan_modem.c index de8237ff8..1da77d321 100755 --- a/channels/chan_modem.c +++ b/channels/chan_modem.c @@ -28,6 +28,7 @@ #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include <netinet/in.h> #include <arpa/inet.h> #include <fcntl.h> #include <sys/ioctl.h> @@ -82,7 +83,7 @@ static ast_mutex_t monlock = AST_MUTEX_INITIALIZER; /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = -1; +static pthread_t monitor_thread = (pthread_t) -1; static int restart_monitor(void); @@ -644,7 +645,7 @@ static void *do_monitor(void *data) static int restart_monitor() { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == -2) + if (monitor_thread == (pthread_t) -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -655,7 +656,7 @@ static int restart_monitor() ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != -1) { + if (monitor_thread != (pthread_t) -1) { pthread_cancel(monitor_thread); /* Nudge it a little, as it's probably stuck in select */ pthread_kill(monitor_thread, SIGURG); @@ -949,11 +950,11 @@ int unload_module() return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread > -1) { + if (monitor_thread != (pthread_t) -1 && monitor_thread != (pthread_t) -2) { pthread_cancel(monitor_thread); pthread_join(monitor_thread, NULL); } - monitor_thread = -2; + monitor_thread = (pthread_t) -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b2f22ad5e..34a4abef8 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5287,7 +5287,7 @@ restartsearch: static int restart_monitor(void) { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == -2) + if (monitor_thread == (pthread_t) -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -6140,7 +6140,7 @@ int unload_module() pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); } - monitor_thread = -2; + monitor_thread = (pthread_t) -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); |