diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-05-14 21:40:43 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-05-14 21:40:43 +0000 |
commit | 08f91c1192559e847f955c57e7b259a9f1560a43 (patch) | |
tree | a37ef618305865e834fceab21afbecc8214fa482 /main/rtp.c | |
parent | c51989a309f2b50714f4c1bcad3987913fdb1f56 (diff) |
Merged revisions 116463 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r116463 | russell | 2008-05-14 16:32:00 -0500 (Wed, 14 May 2008) | 4 lines
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: https://origsvn.digium.com/svn/asterisk/trunk@116469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/rtp.c b/main/rtp.c index e7f849686..647ed808c 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -1096,8 +1096,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; @@ -1440,8 +1439,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; |