summaryrefslogtreecommitdiff
path: root/src/lib/sockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/sockets.c')
-rw-r--r--src/lib/sockets.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/sockets.c b/src/lib/sockets.c
index 9bfbad5e..d60ea91a 100644
--- a/src/lib/sockets.c
+++ b/src/lib/sockets.c
@@ -32,6 +32,7 @@
#include <sys/un.h>
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
int client_socket_open(char * file_name)
{
@@ -109,8 +110,8 @@ irm_msg_t * send_recv_irm_msg(irm_msg_t * msg)
if (sockfd < 0)
return NULL;
- buf.size = irm_msg__get_packed_size(msg);
- if (buf.size == 0) {
+ buf.len = irm_msg__get_packed_size(msg);
+ if (buf.len == 0) {
close(sockfd);
return NULL;
}
@@ -123,7 +124,7 @@ irm_msg_t * send_recv_irm_msg(irm_msg_t * msg)
irm_msg__pack(msg, buf.data);
- if (write(sockfd, buf.data, buf.size) == -1) {
+ if (write(sockfd, buf.data, buf.len) == -1) {
free(buf.data);
close(sockfd);
return NULL;