diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-07-05 16:36:40 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-07-05 16:36:40 +0200 |
commit | 51ccc34e0fe15aaf711f30fa8b63de1e1881029f (patch) | |
tree | 6c75a9574860e436287c5344ad8364d412c73543 /src/lib/sockets.c | |
parent | 627c11526e57b94d466a7d7acd4fe0bf8cd2b776 (diff) | |
parent | daa4e408b3e34bdc228d26816de09d7d1fb9b043 (diff) | |
download | ouroboros-51ccc34e0fe15aaf711f30fa8b63de1e1881029f.tar.gz ouroboros-51ccc34e0fe15aaf711f30fa8b63de1e1881029f.zip |
Merged in sandervrijders/ouroboros/be (pull request #154)
lib: Provide first implementation of revised CDAP
Diffstat (limited to 'src/lib/sockets.c')
-rw-r--r-- | src/lib/sockets.c | 7 |
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; |