diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-25 04:05:31 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-25 04:05:31 +0000 |
commit | 28185415707763e486b57a8cfd48ae588b4f33a8 (patch) | |
tree | 6c0fa019a3fcefef39e2349d0074bbae04c79362 /channels/chan_usbradio.c | |
parent | de52c7b0d1787ebbeb826bc5531af3435e38b4e4 (diff) |
Merged revisions 158992 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r158992 | twilson | 2008-11-24 21:49:30 -0600 (Mon, 24 Nov 2008) | 2 lines
Make chan_usbradio compile under dev mode
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@159024 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_usbradio.c')
-rw-r--r-- | channels/chan_usbradio.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/channels/chan_usbradio.c b/channels/chan_usbradio.c index 06f97939d..11d297ff9 100644 --- a/channels/chan_usbradio.c +++ b/channels/chan_usbradio.c @@ -1028,7 +1028,9 @@ static int usbradio_write(struct ast_channel *c, struct ast_frame *f) tbuff[i] = ((i16 *)(f->data))[i / 2]; tbuff[i + 1] = o->txkeyed * M_Q13; } - fwrite(tbuff, 2, f->datalen, ftxcapraw); + if (fwrite(tbuff, 2, f->datalen, ftxcapraw) != f->datalen) { + ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno)); + } /*fwrite(f->data,1,f->datalen,ftxcapraw); */ } #endif @@ -1041,8 +1043,9 @@ static int usbradio_write(struct ast_channel *c, struct ast_frame *f) #endif #if DEBUG_CAPTURES == 1 - if (o->b.txcap2 && ftxcaptrace) - fwrite((o->pmrChan->ptxDebug), 1, FRAME_SIZE * 2 * 16, ftxcaptrace); + if ((o->b.txcap2 && ftxcaptrace) && (fwrite((o->pmrChan->ptxDebug), 1, FRAME_SIZE * 2 * 16, ftxcaptrace) != FRAME_SIZE * 2 * 16)) { + ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno)); + } #endif src = 0; /* read position into f->data */ @@ -1111,8 +1114,9 @@ static struct ast_frame *usbradio_read(struct ast_channel *c) return f; #if DEBUG_CAPTURES == 1 - if (o->b.rxcapraw && frxcapraw) - fwrite((o->usbradio_read_buf + AST_FRIENDLY_OFFSET), 1, FRAME_SIZE * 2 * 2 * 6, frxcapraw); + if ((o->b.rxcapraw && frxcapraw) && (fwrite((o->usbradio_read_buf + AST_FRIENDLY_OFFSET), 1, FRAME_SIZE * 2 * 2 * 6, frxcapraw) != FRAME_SIZE * 2 * 2 * 6)) { + ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno)); + } #endif #if 1 @@ -1149,7 +1153,9 @@ static struct ast_frame *usbradio_read(struct ast_channel *c) #endif #if DEBUG_CAPTURES == 1 - if (frxcaptrace && o->b.rxcap2) fwrite((o->pmrChan->prxDebug), 1, FRAME_SIZE * 2 * 16, frxcaptrace); + if ((frxcaptrace && o->b.rxcap2) && (fwrite((o->pmrChan->prxDebug), 1, FRAME_SIZE * 2 * 16, frxcaptrace) != FRAME_SIZE * 2 * 16)) { + ast_log(LOG_ERROR, "fwrite() error: %s\n", strerror(errno)); + } #endif if (o->rxcdtype == CD_HID && (o->pmrChan->rxExtCarrierDetect != o->rxhidsq)) @@ -2423,7 +2429,9 @@ int RxTestIt(struct chan_usbradio_pvt *o) PmrRx(pChan, iBuff, oBuff); - fwrite((void *)pChan->prxDebug, 2, numSamples * numChannels, hOutput); + if (fwrite((void *)pChan->prxDebug, 2, numSamples * numChannels, hOutput) != numSamples * numChannels) { + ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno)); + } } pChan->b.txCapture = 0; pChan->b.rxCapture = 0; |