From f46bcc5b6f0d0f5c8a25bc34f04e8bce7c664180 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Tue, 6 Jan 2015 14:18:03 +0000 Subject: [PATCH] please lint. git-svn-id: file:///svn/unbound/trunk@3305 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/remote.c | 4 +++- services/listen_dnsport.c | 4 ++-- smallapp/unbound-control.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index a1d2628a9..e0cfa0dc4 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -142,6 +142,7 @@ timeval_divide(struct timeval* avg, const struct timeval* sum, size_t d) * The following function was generated using the openssl utility, using * the command : "openssl dhparam -dsaparam -C 512" */ +#ifndef S_SPLINT_S DH *get_dh512() { static unsigned char dh512_p[]={ @@ -170,6 +171,7 @@ DH *get_dh512() dh->length = 160; return(dh); } +#endif /* SPLINT */ struct daemon_remote* daemon_remote_create(struct config_file* cfg) @@ -326,7 +328,7 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err, if(fd != -1) { if (cfg->username && cfg->username[0]) chown(ip, cfg->uid, cfg->gid); - chmod(ip, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); + chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)); } } else { hints.ai_socktype = SOCK_STREAM; diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 243a7b38b..870c15e3b 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -606,7 +606,7 @@ create_local_accept_sock(const char *path, int* noproto) #endif sun.sun_family = AF_LOCAL; /* length is 92-108, 104 on FreeBSD */ - strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); + (void)strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) { log_err("Cannot create local socket %s (%s)", @@ -622,7 +622,7 @@ create_local_accept_sock(const char *path, int* noproto) } if (bind(s, (struct sockaddr *)&sun, - sizeof(struct sockaddr_un)) == -1) { + (socklen_t)sizeof(struct sockaddr_un)) == -1) { log_err("Cannot bind local socket %s (%s)", path, strerror(errno)); return -1; diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index 759509201..75e2fc86c 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -209,8 +209,8 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd) #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN sun->sun_len = sizeof(sun); #endif - strlcpy(sun->sun_path, svr, sizeof(sun->sun_path)); - addrlen = sizeof(struct sockaddr_un); + (void)strlcpy(sun->sun_path, svr, sizeof(sun->sun_path)); + addrlen = (socklen_t)sizeof(struct sockaddr_un); addrfamily = AF_LOCAL; #endif } else { -- 2.47.2