diff options
| author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-17 12:08:49 +0200 |
|---|---|---|
| committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-18 22:25:34 +0200 |
| commit | 21b304b46a347772c1338b22fba6a15291bb2945 (patch) | |
| tree | eb8d0980ded5216b282a7932ecce38fd09473210 /src/lib/sockets.c | |
| parent | d8e9019fcb56a49c6730bbe7d47e5e1cec682a2d (diff) | |
| download | ouroboros-21b304b46a347772c1338b22fba6a15291bb2945.zip ouroboros-21b304b46a347772c1338b22fba6a15291bb2945.tar.gz | |
ipcpd: initial IPC processes
Basic functions for implementation of IPC processes, and
implementation of core functions of the shim IPCP over UDP. Updates
to the build system to compile these IPC processes, as well as some
fixes in the irmd (rudimentary capturing exit signals) and some fixes
in the library, mainly relating to the messaging.
Basic implementation of creation / bootstrapping / deletion of the
shim UDP. Placeholders for other functions.
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 805dda3..4f77780 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; |
