aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-14 21:32:00 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-14 21:32:00 +0000
commit848841973a5c5b8d2de336ed32f5b4ab80ca8d79 (patch)
treed36d7d542d0d6ba89c806a8acd12d366bd58a368 /main/rtp.c
parentec6b2c6e0554dd4374dea87f80d99f9495a80b03 (diff)
Add ast_assert(), which can be used to handle fatal errors. It is only compiled
in if dev-mode is enabled, and only aborts if DO_CRASH is defined. (inspired by issue #12650) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116463 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 658bd0891..2597fb178 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -855,8 +855,7 @@ struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
rtcpheader = (unsigned int *)(rtcpdata + AST_FRIENDLY_OFFSET);
if (res < 0) {
- if (errno == EBADF)
- CRASH;
+ ast_assert(errno != EBADF);
if (errno != EAGAIN) {
ast_log(LOG_WARNING, "RTCP Read error: %s. Hanging up.\n", strerror(errno));
return NULL;
@@ -1134,8 +1133,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
rtpheader = (unsigned int *)(rtp->rawdata + AST_FRIENDLY_OFFSET);
if (res < 0) {
- if (errno == EBADF)
- CRASH;
+ ast_assert(errno != EBADF);
if (errno != EAGAIN) {
ast_log(LOG_WARNING, "RTP Read error: %s. Hanging up.\n", strerror(errno));
return NULL;