usock: use strerror to get a better insight about an error.
This commit is contained in:
parent
71eb8b3f61
commit
e936810b39
@ -158,8 +158,13 @@ struct ipc_error usock_connect (int32_t * fd, const char *path)
|
|||||||
TEST_IPC_RETURN_ON_ERROR(directory_setup_ (path));
|
TEST_IPC_RETURN_ON_ERROR(directory_setup_ (path));
|
||||||
|
|
||||||
if (connect (sfd, (struct sockaddr *)&my_addr, peer_addr_size) == -1) {
|
if (connect (sfd, (struct sockaddr *)&my_addr, peer_addr_size) == -1) {
|
||||||
IPC_RETURN_ERROR_FORMAT (IPC_ERROR_USOCK_CONNECT__CONNECT
|
char *str_error = strerror (errno);
|
||||||
, "unix socket connection to the path %s not possible", path);
|
SECURE_BUFFER_DECLARATION(char, error_message, BUFSIZ);
|
||||||
|
snprintf (error_message, BUFSIZ
|
||||||
|
, "unix socket connection to the path %s not possible:%s"
|
||||||
|
, path, str_error);
|
||||||
|
|
||||||
|
IPC_RETURN_ERROR_FORMAT (IPC_ERROR_USOCK_CONNECT__CONNECT, "%s", error_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
*fd = sfd;
|
*fd = sfd;
|
||||||
|
Reference in New Issue
Block a user