summaryrefslogtreecommitdiff
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-04-17 21:14:49 +0000
committerMatthew Jordan <mjordan@digium.com>2012-04-17 21:14:49 +0000
commit016dfa01f1883a246c8944014ce0ecadff651a81 (patch)
tree176fdd07f911332ec9bba1e0e2d83b296a79eeea /res/res_musiconhold.c
parentf88a632d96bb3ed76976b2f32f5d7b7e8591afa9 (diff)
Fix places in resources where a negative return value could impact execution
This patch addresses a number of modules in resources that did not handle the negative return value from function calls adequately. This includes: * res_agi.c: if the result of the read function is a negative number, indicating some failure, the result would instead be treated as the number of bytes read. This patch now treats negative results in the same manner as an end of file condition, with the exception that it also logs the error code indicated by the return. * res_musiconhold.c: if spawn_mp3 fails to assign a file descriptor to srcfd, and instead assigns a negative value, that file descriptor could later be passed to functions that require a valid file descriptor. If spawn_mp3 fails, we now immediately retry instead of continuing in the logic. * res_rtp_asterisk.c: if no codec can be matched between two RTP instances in a peer to peer bridge, we immediately return instead of attempting to use the codec payload type as an index to determine the appropriate negotiated codec. (issue ASTERISK-19655) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1863/ ........ Merged revisions 362362 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362364 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 7d5c96922..ec990d5d1 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -681,7 +681,7 @@ static void *monmp3thread(void *data)
ast_log(LOG_WARNING, "Unable to spawn mp3player\n");
/* Try again later */
sleep(500);
- pthread_testcancel();
+ continue;
}
}
if (class->timer) {