diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-04-23 09:53:35 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-04-23 09:53:35 +0200 |
commit | b6dc5ba9576d61d42db82c3da8cb0c039fac7179 (patch) | |
tree | 0de76147c8a7beb4c23a1931f822113b61c51a5b /src/lib/sockets.c | |
parent | 9687ace9a1faf752672774ae49a6428b378fa409 (diff) | |
parent | a618984537f7790cd274d097223b4029473044c2 (diff) | |
download | ouroboros-b6dc5ba9576d61d42db82c3da8cb0c039fac7179.tar.gz ouroboros-b6dc5ba9576d61d42db82c3da8cb0c039fac7179.zip |
Merge remote-tracking branch 'upstream/be' into be
Diffstat (limited to 'src/lib/sockets.c')
-rw-r--r-- | src/lib/sockets.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/sockets.c b/src/lib/sockets.c index 805dda39..4f777805 100644 --- a/src/lib/sockets.c +++ b/src/lib/sockets.c @@ -29,7 +29,6 @@ #include <sys/socket.h> #include <sys/un.h> -#include <sys/stat.h> #include <string.h> #include <stdlib.h> @@ -61,9 +60,8 @@ int server_socket_open(char * file_name) { int sockfd; struct sockaddr_un serv_addr; - struct stat sb; - if (!stat(file_name, &sb)) { + if (access(file_name, F_OK) != -1) { /* File exists */ if (unlink(file_name)) { LOG_ERR("Failed to unlink filename: %s", @@ -113,8 +111,7 @@ irm_msg_t * send_recv_irm_msg(irm_msg_t * msg) return NULL; } - LOG_DBG("Size will be %lu", buf.size); - buf.data = malloc(buf.size); + buf.data = malloc(IRM_MSG_BUF_SIZE); if (buf.data == NULL) { close(sockfd); return NULL; |