usr.sbin/ypldap: fix -Wunused-but-set-variable warnings

* "wrlen" has been write-only since the code was imported.
* Removing "dns_pid" replicates ntpd/ntp.c 1.122 (aece4353519f).
* yp_check() looks like unfinished code.  Rather than removing it
  we can ifdef it out.

ok?
 
M  usr.sbin/ypldap/entries.c
M  usr.sbin/ypldap/ldapclient.c
M  usr.sbin/ypldap/yp.c

diff 34d4cced9a849c8319a25fd1cc1a7567223349c3 
5cdc3b04d0d3c70c2a9f0393913a5fdf64c11021
blob - 3e2cc672786cad83caac1a22dfd2516c3ae9a3eb
blob + b7394892eafe85bb1e8b9bb8e8cfdcc6658606f3
--- usr.sbin/ypldap/entries.c
+++ usr.sbin/ypldap/entries.c
@@ -38,7 +38,6 @@
 void
 flatten_entries(struct env *env)
 {
-       size_t           wrlen;
        size_t           len;
        char            *linep;
        char            *endp;
@@ -54,7 +53,6 @@ flatten_entries(struct env *env)
         *
         * An extra octet is alloced to make space for an additional NUL.
         */
-       wrlen = env->sc_user_line_len;
        if ((linep = calloc(1, env->sc_user_line_len + 1)) == NULL) {
                /*
                 * XXX: try allocating a smaller chunk of memory
@@ -76,7 +74,6 @@ flatten_entries(struct env *env)
                free(ue->ue_line);
                ue->ue_line = endp;
                endp += len;
-               wrlen -= len;
 
                /*
                 * To save memory strdup(3) the netid_line which originally used
@@ -92,7 +89,6 @@ flatten_entries(struct env *env)
        env->sc_user_lines = linep;
        log_debug("done pushing users");
 
-       wrlen = env->sc_group_line_len;
        if ((linep = calloc(1, env->sc_group_line_len + 1)) == NULL) {
                /*
                 * XXX: try allocating a smaller chunk of memory
@@ -113,7 +109,6 @@ flatten_entries(struct env *env)
                free(ge->ge_line);
                ge->ge_line = endp;
                endp += len;
-               wrlen -= len;
        }
        env->sc_group_lines = linep;
        log_debug("done pushing groups");
blob - 473986a8c5ed2449844e78cab034c6736b4a0e0f
blob + 96e502ded7e3a3428a70411e628a988b4713fa90
--- usr.sbin/ypldap/ldapclient.c
+++ usr.sbin/ypldap/ldapclient.c
@@ -357,7 +357,7 @@ client_shutdown(void)
 pid_t
 ldapclient(int pipe_main2client[2])
 {
-       pid_t            pid, dns_pid;
+       pid_t            pid;
        int              pipe_dns[2];
        struct passwd   *pw;
        struct event     ev_sigint;
@@ -382,7 +382,7 @@ ldapclient(int pipe_main2client[2])
 
        if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1)
                fatal("socketpair");
-       dns_pid = ypldap_dns(pipe_dns, pw);
+       ypldap_dns(pipe_dns, pw);
        close(pipe_dns[1]);
 
 #ifndef DEBUG
blob - 84b5d59102057003557b1478af1b643b5aebdc69
blob + 02a654e1daf2087889afc61630c30c02c6492156
--- usr.sbin/ypldap/yp.c
+++ usr.sbin/ypldap/yp.c
@@ -268,12 +268,14 @@ yp_dispatch(struct svc_req *req, SVCXPRT *trans)
 int
 yp_check(struct svc_req *req)
 {
+#ifdef notyet
        struct sockaddr_in      *caller;
 
        caller = svc_getcaller(req->rq_xprt);
        /*
         * We might want to know who we allow here.
         */
+#endif
        return (0);
 }
 

-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to