mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
ipc: Log unexpected messaging events as errors
Any of these unexpected events will likely lead to more errors down the line. Always printing them as errors will make it easier to diagnose the ipc.
This commit is contained in:
parent
a195f22bc3
commit
d491f59b55
|
@ -90,7 +90,7 @@ compositor_disconnect(ipc_connection_t *ipc_c)
|
|||
|
||||
#define CALL_CHK(call) \
|
||||
if ((call) != IPC_SUCCESS) { \
|
||||
IPC_DEBUG(icc->ipc_c, "IPC: %s call error!", __func__); \
|
||||
IPC_ERROR(icc->ipc_c, "IPC: %s call error!", __func__); \
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@ ipc_client_send_and_get_reply(struct ipc_connection *ipc_c,
|
|||
size_t reply_size)
|
||||
{
|
||||
if (ipc_c->socket_fd < 0) {
|
||||
IPC_DEBUG(ipc_c, "Error sending - not connected!");
|
||||
IPC_ERROR(ipc_c, "Error sending - not connected!");
|
||||
return IPC_FAILURE;
|
||||
}
|
||||
|
||||
ssize_t len = send(ipc_c->socket_fd, msg_ptr, msg_size, 0);
|
||||
if ((size_t)len != msg_size) {
|
||||
IPC_DEBUG(ipc_c, "Error sending - cannot continue!");
|
||||
IPC_ERROR(ipc_c, "Error sending - cannot continue!");
|
||||
return IPC_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -52,13 +52,13 @@ ipc_client_send_and_get_reply(struct ipc_connection *ipc_c,
|
|||
|
||||
len = recvmsg(ipc_c->socket_fd, &msg, 0);
|
||||
if (len < 0) {
|
||||
IPC_DEBUG(ipc_c, "recvmsg failed with error: %s",
|
||||
IPC_ERROR(ipc_c, "recvmsg failed with error: %s",
|
||||
strerror(errno));
|
||||
return IPC_FAILURE;
|
||||
}
|
||||
|
||||
if ((size_t)len != reply_size) {
|
||||
IPC_DEBUG(ipc_c, "recvmsg failed with error: no data");
|
||||
IPC_ERROR(ipc_c, "recvmsg failed with error: wrong size");
|
||||
return IPC_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ ipc_client_send_and_get_reply_fds(ipc_connection_t *ipc_c,
|
|||
size_t num_fds)
|
||||
{
|
||||
if (send(ipc_c->socket_fd, msg_ptr, msg_size, 0) == -1) {
|
||||
IPC_DEBUG(ipc_c, "Error sending - cannot continue!");
|
||||
IPC_ERROR(ipc_c, "Error sending - cannot continue!");
|
||||
return IPC_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -96,13 +96,13 @@ ipc_client_send_and_get_reply_fds(ipc_connection_t *ipc_c,
|
|||
ssize_t len = recvmsg(ipc_c->socket_fd, &msg, 0);
|
||||
|
||||
if (len < 0) {
|
||||
IPC_DEBUG(ipc_c, "recvmsg failed with error: %s",
|
||||
IPC_ERROR(ipc_c, "recvmsg failed with error: %s",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
IPC_DEBUG(ipc_c, "recvmsg failed with error: no data");
|
||||
IPC_ERROR(ipc_c, "recvmsg failed with error: no data");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue