]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- made lint clean.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 24 Jan 2014 13:23:45 +0000 (13:23 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 24 Jan 2014 13:23:45 +0000 (13:23 +0000)
git-svn-id: file:///svn/unbound/trunk@3050 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/daemon.c
daemon/daemon.h
daemon/unbound.c
doc/Changelog
services/listen_dnsport.c
smallapp/unbound-checkconf.c
testcode/delayer.c
util/config_file.c
util/net_help.c
util/netevent.c

index c234eee11c6696b0af398b0423c2c263d2560837..44d0b87c91b1890a4f16220f707935bf2b7a2455 100644 (file)
@@ -255,7 +255,7 @@ daemon_open_shared_ports(struct daemon* daemon)
 {
        log_assert(daemon);
        if(daemon->cfg->port != daemon->listening_port) {
-               int i;
+               size_t i;
 #if defined(__linux__) && defined(SO_REUSEPORT)
                if(daemon->cfg->so_reuseport && daemon->cfg->num_threads > 0)
                        daemon->num_ports = daemon->cfg->num_threads;
@@ -568,7 +568,7 @@ daemon_cleanup(struct daemon* daemon)
 void 
 daemon_delete(struct daemon* daemon)
 {
-       int i;
+       size_t i;
        if(!daemon)
                return;
        modstack_desetup(&daemon->mods, daemon->env);
index f91232be6b06b633ce079ac87d269deb36b99386..fdf7683aba387c7c7aee2f36ed9c55ef04d11797 100644 (file)
@@ -76,7 +76,7 @@ struct daemon {
         * or just one element[0] shared by the worker threads. */
        struct listen_port** ports;
        /** size of ports array */
-       int num_ports;
+       size_t num_ports;
        /** port number for remote that has ports opened. */
        int rc_port;
        /** listening ports for remote control */
index 8de3f6b980d82e52fb1004a4d3b1da4527afe43a..76e82692cce792e7d9d11652ac8921685c538985 100644 (file)
 #include <grp.h>
 #endif
 
+#ifndef S_SPLINT_S
+/* splint chokes on this system header file */
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
+#endif /* S_SPLINT_S */
 #ifdef HAVE_LOGIN_CAP_H
 #include <login_cap.h>
 #endif
@@ -192,6 +195,7 @@ int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
 static void
 checkrlimits(struct config_file* cfg)
 {
+#ifndef S_SPLINT_S
 #ifdef HAVE_GETRLIMIT
        /* list has number of ports to listen to, ifs number addresses */
        int list = ((cfg->do_udp?1:0) + (cfg->do_tcp?1 + 
@@ -282,6 +286,7 @@ checkrlimits(struct config_file* cfg)
 #else  
        (void)cfg;
 #endif /* HAVE_GETRLIMIT */
+#endif /* S_SPLINT_S */
 }
 
 /** set verbosity, check rlimits, cache settings */
index 27a1f6ecd726c8b33715113287394473c322bcaa..5457b411067abc649bdc3fcc2cb40daa48cb7561 100644 (file)
@@ -6,6 +6,7 @@
          lock contention on localzones.lock.  It is changed to an rwlock.
        - so-reuseport: yesno option to distribute queries evenly over
          threads on Linux (Thanks Robert Edmonds).
+       - made lint clean.
 
 21 January 2014: Wouter
        - Fix #547: no trustanchor written if filesystem full, fclose checked.
index cd9bce8af6dd512fed7b7279cc355508811385ce..63521e3e808b4a1e67ab9c50a0678f5071e502c0 100644 (file)
@@ -76,7 +76,7 @@ verbose_print_addr(struct addrinfo *addr)
 #endif /* INET6 */
                if(inet_ntop(addr->ai_family, sinaddr, buf,
                        (socklen_t)sizeof(buf)) == 0) {
-                       strlcpy(buf, "(null)", sizeof(buf));
+                       (void)strlcpy(buf, "(null)", sizeof(buf));
                }
                buf[sizeof(buf)-1] = 0;
                verbose(VERB_ALGO, "creating %s%s socket %s %d", 
@@ -617,9 +617,9 @@ make_sock_port(int stype, const char* ifname, const char* port,
                        *noip6 = 0;
                        return -1;
                }
-               strlcpy(newif, ifname, sizeof(newif));
+               (void)strlcpy(newif, ifname, sizeof(newif));
                newif[s-ifname] = 0;
-               strlcpy(p, s+1, sizeof(p));
+               (void)strlcpy(p, s+1, sizeof(p));
                p[strlen(s+1)]=0;
                return make_sock(stype, newif, p, hints, v6only, noip6,
                        rcv, snd, reuseport);
index 47c1d2a9d1b8654b915065617062937a1df5ffcf..4ee268272273246ca5e281c3f8658a87072c2c52 100644 (file)
@@ -344,9 +344,9 @@ morechecks(struct config_file* cfg, const char* fname)
                if(fname[0] != '/') {
                        if(getcwd(buf, sizeof(buf)) == NULL)
                                fatal_exit("getcwd: %s", strerror(errno));
-                       strlcat(buf, "/", sizeof(buf));
+                       (void)strlcat(buf, "/", sizeof(buf));
                }
-               strlcat(buf, fname, sizeof(buf));
+               (void)strlcat(buf, fname, sizeof(buf));
                if(strncmp(buf, cfg->chrootdir, strlen(cfg->chrootdir)) != 0)
                        fatal_exit("config file %s is not inside chroot %s",
                                buf, cfg->chrootdir);
index db705cf964873070f0d4dd39920ff27fdf1cc683..83e57e33962a42a0b79ae596e675f2667ac4cb6e 100644 (file)
@@ -890,12 +890,12 @@ proxy_list_clear(struct proxy* p)
                        if(inet_ntop(AF_INET6, 
                                &((struct sockaddr_in6*)&p->addr)->sin6_addr,
                                from, (socklen_t)sizeof(from)) == 0)
-                               strlcpy(from, "err", sizeof(from));
+                               (void)strlcpy(from, "err", sizeof(from));
                } else {
                        if(inet_ntop(AF_INET, 
                                &((struct sockaddr_in*)&p->addr)->sin_addr,
                                from, (socklen_t)sizeof(from)) == 0)
-                               strlcpy(from, "err", sizeof(from));
+                               (void)strlcpy(from, "err", sizeof(from));
                }
                printf("client[%d]: last %s@%d of %d : %u in, %u out, "
                        "%u returned\n", i++, from, port, (int)p->numreuse+1,
index 931605f44485ba7a947b53d173ecd409e5f465b0..510f0d3e18fa34154f1a2011118b3029cd4d1a9d 100644 (file)
@@ -1250,14 +1250,14 @@ fname_after_chroot(const char* fname, struct config_file* cfg, int use_chdir)
        if(cfg->chrootdir && cfg->chrootdir[0] && 
                strncmp(cfg->chrootdir, fname, strlen(cfg->chrootdir)) == 0) {
                /* already full pathname, return it */
-               strlcpy(buf, fname, len);
+               (void)strlcpy(buf, fname, len);
                buf[len-1] = 0;
                return buf;
        }
        /* chroot */
        if(cfg->chrootdir && cfg->chrootdir[0]) {
                /* start with chrootdir */
-               strlcpy(buf, cfg->chrootdir, len);
+               (void)strlcpy(buf, cfg->chrootdir, len);
                slashit = 1;
        }
 #ifdef UB_ON_WINDOWS
@@ -1271,20 +1271,20 @@ fname_after_chroot(const char* fname, struct config_file* cfg, int use_chdir)
        } else if(cfg->directory && cfg->directory[0]) {
                /* prepend chdir */
                if(slashit && cfg->directory[0] != '/')
-                       strlcat(buf, "/", len);
+                       (void)strlcat(buf, "/", len);
                /* is the directory already in the chroot? */
                if(cfg->chrootdir && cfg->chrootdir[0] && 
                        strncmp(cfg->chrootdir, cfg->directory, 
                        strlen(cfg->chrootdir)) == 0)
-                       strlcat(buf, cfg->directory+strlen(cfg->chrootdir), 
+                       (void)strlcat(buf, cfg->directory+strlen(cfg->chrootdir), 
                                   len);
-               else strlcat(buf, cfg->directory, len);
+               else (void)strlcat(buf, cfg->directory, len);
                slashit = 1;
        }
        /* fname */
        if(slashit && fname[0] != '/')
-               strlcat(buf, "/", len);
-       strlcat(buf, fname, len);
+               (void)strlcat(buf, "/", len);
+       (void)strlcat(buf, fname, len);
        buf[len-1] = 0;
        return buf;
 }
@@ -1336,7 +1336,7 @@ cfg_parse_local_zone(struct config_file* cfg, const char* val)
                log_err("syntax error: bad zone name: %s", val);
                return 0;
        }
-       strlcpy(buf, name, sizeof(buf));
+       (void)strlcpy(buf, name, sizeof(buf));
        buf[name_end-name] = '\0';
 
        type = last_space_pos(name_end);
index 079efb1a9d2f49cf7567b81f0df4bfb4a03cfec2..2bba16e59b90dba79793edcb31593078dcd2fb7e 100644 (file)
@@ -160,7 +160,7 @@ log_addr(enum verbosity_value v, const char* str,
                default: break;
        }
        if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {
-               strlcpy(dest, "(inet_ntop error)", sizeof(dest));
+               (void)strlcpy(dest, "(inet_ntop error)", sizeof(dest));
        }
        dest[sizeof(dest)-1] = 0;
        port = ntohs(((struct sockaddr_in*)addr)->sin_port);
@@ -181,7 +181,7 @@ extstrtoaddr(const char* str, struct sockaddr_storage* addr,
                if(s-str >= MAX_ADDR_STRLEN) {
                        return 0;
                }
-               strlcpy(buf, str, sizeof(buf));
+               (void)strlcpy(buf, str, sizeof(buf));
                buf[s-str] = 0;
                port = atoi(s+1);
                if(port == 0 && strcmp(s+1,"0")!=0) {
@@ -211,7 +211,7 @@ ipstrtoaddr(const char* ip, int port, struct sockaddr_storage* addr,
                if((s=strchr(ip, '%'))) { /* ip6%interface, rfc 4007 */
                        if(s-ip >= MAX_ADDR_STRLEN)
                                return 0;
-                       strlcpy(buf, ip, sizeof(buf));
+                       (void)strlcpy(buf, ip, sizeof(buf));
                        buf[s-ip]=0;
                        sa->sin6_scope_id = (uint32_t)atoi(s+1);
                        ip = buf;
@@ -317,7 +317,7 @@ void log_name_addr(enum verbosity_value v, const char* str, uint8_t* zone,
                default: break;
        }
        if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {
-               strlcpy(dest, "(inet_ntop error)", sizeof(dest));
+               (void)strlcpy(dest, "(inet_ntop error)", sizeof(dest));
        }
        dest[sizeof(dest)-1] = 0;
        port = ntohs(((struct sockaddr_in*)addr)->sin_port);
index 4ba5214473659b48d5da4f591cfa330854865618..e792bbde49048f3fed29e47adb6b4fb17298628b 100644 (file)
@@ -423,7 +423,7 @@ static void p_ancil(const char* str, struct comm_reply* r)
                char buf[1024];
                if(inet_ntop(AF_INET6, &r->pktinfo.v6info.ipi6_addr, 
                        buf, (socklen_t)sizeof(buf)) == 0) {
-                       strlcpy(buf, "(inet_ntop error)", sizeof(buf));
+                       (void)strlcpy(buf, "(inet_ntop error)", sizeof(buf));
                }
                buf[sizeof(buf)-1]=0;
                log_info("%s: %s %d", str, buf, r->pktinfo.v6info.ipi6_ifindex);
@@ -432,13 +432,13 @@ static void p_ancil(const char* str, struct comm_reply* r)
                char buf1[1024], buf2[1024];
                if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_addr, 
                        buf1, (socklen_t)sizeof(buf1)) == 0) {
-                       strlcpy(buf1, "(inet_ntop error)", sizeof(buf1));
+                       (void)strlcpy(buf1, "(inet_ntop error)", sizeof(buf1));
                }
                buf1[sizeof(buf1)-1]=0;
 #ifdef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
                if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_spec_dst, 
                        buf2, (socklen_t)sizeof(buf2)) == 0) {
-                       strlcpy(buf2, "(inet_ntop error)", sizeof(buf2));
+                       (void)strlcpy(buf2, "(inet_ntop error)", sizeof(buf2));
                }
                buf2[sizeof(buf2)-1]=0;
 #else
@@ -450,7 +450,7 @@ static void p_ancil(const char* str, struct comm_reply* r)
                char buf1[1024];
                if(inet_ntop(AF_INET, &r->pktinfo.v4addr, 
                        buf1, (socklen_t)sizeof(buf1)) == 0) {
-                       strlcpy(buf1, "(inet_ntop error)", sizeof(buf1));
+                       (void)strlcpy(buf1, "(inet_ntop error)", sizeof(buf1));
                }
                buf1[sizeof(buf1)-1]=0;
                log_info("%s: %s", str, buf1);