summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-11-02 18:52:13 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-11-02 18:52:13 +0000
commitbd4eb070f3b292617be20bda069cac47df2f7495 (patch)
treea3750d996d41e35c5df34c29533dd7d9fdcaff24 /main/channel.c
parent1e6864dd9d894db29ebc350b015e9eb58226a021 (diff)
bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/main/channel.c b/main/channel.c
index 6ace4c008..4174613ec 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2272,8 +2272,11 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
break;
case AST_FRAME_VOICE:
/* Write audio if appropriate */
- if (audiofd > -1)
- write(audiofd, f->data.ptr, f->datalen);
+ if (audiofd > -1) {
+ if (write(audiofd, f->data.ptr, f->datalen) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
+ }
default:
/* Ignore */
break;
@@ -2420,7 +2423,9 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
goto done;
}
}
- read(chan->alertpipe[0], &blah, sizeof(blah));
+ if (read(chan->alertpipe[0], &blah, sizeof(blah)) < 0) {
+ ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
+ }
}
if (chan->timingfd > -1 && chan->fdno == AST_TIMING_FD) {
@@ -3887,7 +3892,10 @@ int ast_do_masquerade(struct ast_channel *original)
AST_LIST_INSERT_TAIL(&original->readq, current, frame_list);
if (original->alertpipe[1] > -1) {
int poke = 0;
- write(original->alertpipe[1], &poke, sizeof(poke));
+
+ if (write(original->alertpipe[1], &poke, sizeof(poke)) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
}
}
}