From ee217678fc4aab83156c81f72a07bcc7a32e0f4d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 25 Jan 2008 15:20:14 +0000 Subject: [PATCH] fix build err git-svn-id: http://svn.openzap.org/svn/openzap/trunk@370 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/zap_io.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libs/openzap/src/zap_io.c b/libs/openzap/src/zap_io.c index 4f18f971d7..9013acb4de 100644 --- a/libs/openzap/src/zap_io.c +++ b/libs/openzap/src/zap_io.c @@ -1484,8 +1484,11 @@ zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *data status = zchan->zio->read(zchan, data, datalen); if (zchan->fds[0]) { - unsigned int dlen = (unsigned int) *datalen; - write(zchan->fds[0], data, dlen); + int dlen = (int) *datalen; + if (write(zchan->fds[0], data, dlen) != dlen) { + snprintf(zchan->last_error, sizeof(zchan->last_error), "write error!"); + return ZAP_FAIL; + } } if (status == ZAP_SUCCESS && zap_test_flag(zchan, ZAP_CHANNEL_TRANSCODE) && zchan->effective_codec != zchan->native_codec) { @@ -1729,8 +1732,11 @@ zap_status_t zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t data } if (zchan->fds[1]) { - unsigned int dlen = (unsigned int) *datalen; - write(zchan->fds[1], data, dlen); + int dlen = (int) *datalen; + if ((write(zchan->fds[1], data, dlen)) != dlen) { + snprintf(zchan->last_error, sizeof(zchan->last_error), "write error!"); + return ZAP_FAIL; + } } status = zchan->zio->write(zchan, data, datalen);