git: 8457b7f426b0 - main - ypldap: Remove set but unused variables.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 20 Jun 2023 16:29:26 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8457b7f426b074a2eb93002fc9d2268690a3cf32 commit 8457b7f426b074a2eb93002fc9d2268690a3cf32 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2023-06-20 16:29:00 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-06-20 16:29:00 +0000 ypldap: Remove set but unused variables. Some of these were reported by GCC, others reported by clang. --- usr.sbin/ypldap/entries.c | 5 ----- usr.sbin/ypldap/ldapclient.c | 4 ++-- usr.sbin/ypldap/yp.c | 3 --- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/usr.sbin/ypldap/entries.c b/usr.sbin/ypldap/entries.c index 1d57d5cd7b05..9176e9ba1862 100644 --- a/usr.sbin/ypldap/entries.c +++ b/usr.sbin/ypldap/entries.c @@ -40,7 +40,6 @@ void flatten_entries(struct env *env) { - size_t wrlen; size_t len; char *linep; char *endp; @@ -56,7 +55,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 @@ -78,7 +76,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 @@ -94,7 +91,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 @@ -115,7 +111,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"); diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c index 5f446a6f847e..fbd6fcd3dc65 100644 --- a/usr.sbin/ypldap/ldapclient.c +++ b/usr.sbin/ypldap/ldapclient.c @@ -346,7 +346,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; @@ -371,7 +371,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 diff --git a/usr.sbin/ypldap/yp.c b/usr.sbin/ypldap/yp.c index 0cbadc371c5e..cfaea38f76c4 100644 --- a/usr.sbin/ypldap/yp.c +++ b/usr.sbin/ypldap/yp.c @@ -268,9 +268,6 @@ yp_dispatch(struct svc_req *req, SVCXPRT *trans) int yp_check(struct svc_req *req) { - struct sockaddr_in *caller; - - caller = svc_getcaller(req->rq_xprt); /* * We might want to know who we allow here. */