[IMPROVE] improve write_to_buf error message 48/17648/3
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Fri, 7 Mar 2014 08:51:27 +0000 (12:51 +0400)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Sat, 29 Mar 2014 05:43:34 +0000 (22:43 -0700)
print additional parmeters in LOGE message

Change-Id: I47add597227e4f044ec659cc482238585d090346
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/buffer.c

index a5108aa..8bf58d4 100644 (file)
@@ -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;