int request_type;
int ret;
int buffer_len = REQUEST_BUFFER_MAX;
+ char err_buf[BUFF_MAX];
request_type = split_request_type_and_args(buffer, &args);
}
ADD_RESPONSE(response, buffer_len, "%d", ret);
- if (send(client->socket_fd, _response, strlen(_response), 0) < 0)
- _E("Failed to send respones, error: %s", strerror(errno));
+ if (send(client->socket_fd, _response, strlen(_response), 0) < 0) {
+ strerror_r(errno, err_buf, BUFF_MAX);
+ _E("Failed to send respones, errno: %d, error: %s", errno, err_buf);
+ }
}
static GList *g_request_client_head;
char buffer[REQUEST_BUFFER_MAX + 1];
struct request_client *client = (struct request_client *)data;
int len;
+ char err_buf[BUFF_MAX];
_D("Start worker thread for client-%d", client->socket_fd);
}
if (len < 0) {
- _E("Error occurs while receiving request: %s", strerror(errno));
+ strerror_r(errno, err_buf, BUFF_MAX);
+ _E("Error occurs while receiving request: errno: %d, error: %s",
+ errno, err_buf);
goto out;
}