From 50efbcba5fc9b58787f51a30c9a362540e6041d6 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 13 Jun 2014 21:49:48 +1000 Subject: [PATCH] Fix various warnings --- src/connector.c | 6 ++++-- src/stratifier.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/connector.c b/src/connector.c index b21205e8..36911e5f 100644 --- a/src/connector.c +++ b/src/connector.c @@ -436,6 +436,7 @@ static void send_fd(int fd, int sockd) struct iovec iov[1]; struct msghdr msg; char buf[2]; + int *cd; memset(&cmptr, 0, sizeof(struct cmsghdr)); iov[0].iov_base = buf; @@ -447,7 +448,8 @@ static void send_fd(int fd, int sockd) cmptr.cmsg_level = SOL_SOCKET; cmptr.cmsg_type = SCM_RIGHTS; cmptr.cmsg_len = CMSG_LEN(sizeof(int)); - *(int *)CMSG_DATA(&cmptr) = fd; + cd = (int *)CMSG_DATA(&cmptr); + *cd = fd; buf[1] = 0; buf[0] = 0; send_unix_data(sockd, &msg, sizeof(struct msghdr)); @@ -455,7 +457,7 @@ static void send_fd(int fd, int sockd) static int connector_loop(proc_instance_t *pi, conn_instance_t *ci) { - int sockd, client_id, ret = 0, selret; + int sockd = -1, client_id, ret = 0, selret; unixsock_t *us = &pi->us; ckpool_t *ckp = pi->ckp; char *buf = NULL; diff --git a/src/stratifier.c b/src/stratifier.c index 0cf5df90..92148ece 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2144,7 +2144,7 @@ static void *authoriser(void *arg) rename_proc("authoriser"); while (42) { - json_t *result_val, *json_msg, *err_val; + json_t *result_val, *json_msg, *err_val = NULL; stratum_instance_t *client; int client_id; char buf[256];