diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 6d740d0..ecd8165 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -8841,7 +8841,7 @@ static int my_dahdi_write(struct dahdi_pvt *p, unsigned char *buf, int len, int res = write(fd, buf, size); if (res != size) { ast_debug(1, "Write returned %d (%s) on channel %d\n", res, strerror(errno), p->channel); - return sent; + return -1; } len -= size; buf += size; @@ -8924,7 +8924,8 @@ static int dahdi_write(struct ast_channel *ast, struct ast_frame *frame) } ast_mutex_unlock(&p->lock); if (res < 0) { - ast_log(LOG_WARNING, "write failed: %s\n", strerror(errno)); + ast_log(LOG_WARNING, "DAHDI channel %d write failed: %s\n", + p->channel, strerror(errno)); return -1; } return 0;