From 36130d2e16d07ffea0f46d8425a6f4e3fc021a16 Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Fri, 7 Mar 2014 12:51:27 +0400 Subject: [PATCH] [IMPROVE] improve write_to_buf error message print additional parmeters in LOGE message Change-Id: I47add597227e4f044ec659cc482238585d090346 Signed-off-by: Vitaliy Cherepanov --- daemon/buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/buffer.c b/daemon/buffer.c index a5108aa..8bf58d4 100644 --- a/daemon/buffer.c +++ b/daemon/buffer.c @@ -127,8 +127,11 @@ void wake_up_buf(void) int write_to_buf(struct msg_data_t *msg) { - if (write(manager.user_ev_fd, msg, MSG_DATA_HDR_LEN + msg->len) == -1) { - LOGE("write to buf: %s\n", strerror(errno)); + uint32_t total_len = MSG_DATA_HDR_LEN + msg->len; + + if (write(manager.user_ev_fd, msg, total_len) == -1) { + LOGE("write to buf (user_ev_fd=%d, msg=%p, len=%d) %s\n", + manager.user_ev_fd, msg, total_len, strerror(errno)); return 1; } return 0; -- 2.7.4