From nobody Tue Jul 21 08:56:58 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h4B8W34dwz6lbsQ for ; Tue, 21 Jul 2026 08:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h4B8V55kRz3dXr for ; Tue, 21 Jul 2026 08:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784624218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEY3fgo70261uaTt5UOZ2Duoxku36TlWXS9tzFtrz1w=; b=ymfFE8rSXvSH4SrmzC/W985tYo8nYInYs0xoJ5vMfFUGgljBYVi4rCLnxFf+jUHCl7jYXN jWgT5IdghUseT3dOsCv6EFSSUdSR+IItiMVFV5PCGR0lxYiDnMX/Fez1KMSAcOmd0im2cp 2BDlmpU5jWoKU4ORyMRae840Ctitsv+L+9i6Cy3JMoSYTWXerMw5jIPwwiHfVSjIM9z51l UFWsgYgRJsWtQPnawt8umITPgSKwypc6wOvXHcSa5aJuEk0boy1NLD2e7OEzgTNTzb8z+d 31k9FSn7ObqAZKHdE2HoVSDAtbTQVjOQbn9Gd8SbmDv3N1YzlWkrKQ2TCmF14w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784624218; a=rsa-sha256; cv=none; b=wp2UY2Vul/PkeayKCRhvwRCbcLncZZlqZ9pabzZhfGObTvCR6+/8ELy2d2FN/P8kNjbeEc l4wNrxdCd6NkYCslda2dqk9VRkDBPQfi7wo++fdJdmpK50Uq+S7aqPLrDV5zTfbZy6A4iQ ObLQr8MXU+3G9gdbN5PwXclK5XfpK3tPbXS1NdDg7fytVXgYfjSC3IZg68PRm4N1f0l2Af XMb95Z6k8GIY1zk05tZqQh8YcP+dHeAlvJKXhtEc2idhIisIB3x3byWK3z017U76VVfOtX wIuG3qRsmUpVFfN8ZtY5QlC6nLOq4MOeNC00MwVNVt9SgH1O7T78MxBSp+d7vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784624218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEY3fgo70261uaTt5UOZ2Duoxku36TlWXS9tzFtrz1w=; b=ePfiuy5WOyzUHt1hIzAR+uJ5rNfhPLk5EfWY/RXbUyojGjTF12HrrKpP4d78aFAKirjSd7 57Rm0HA2BDHdMmqHwuaCsK++x8KjfXWi4lCI7GlSV3tKa8yunM/La8oiL2Fk+j+ykH0x0G PYiFdH1kg0WdME0EZn4YrRpKc8rcpsaK6N3dYSi72zsJZn7cxNF67U6qNplXHC8qz3KRdV H/Rr4Se8hAsfYqyTznSOCtLY8tdPeGBW7G4s6iK1jFkH2NFKPHoCpxLuNiOChaLn3vkgpG 8f1Xx1CyGzrd4TyEPJxc+il1GhN6A6zRifn7i65D+X9ugTckXmGUC/uLLRuLJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h4B8V3my9zjBL for ; Tue, 21 Jul 2026 08:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22228 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 21 Jul 2026 08:56:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 19d044be3307 - stable/14 - libc/resolv: Dead code and style cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 19d044be33078fcddb71db1e33e4d683ce310e1e Auto-Submitted: auto-generated Date: Tue, 21 Jul 2026 08:56:58 +0000 Message-Id: <6a5f345a.22228.4e3209a5@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=19d044be33078fcddb71db1e33e4d683ce310e1e commit 19d044be33078fcddb71db1e33e4d683ce310e1e Author: Dag-Erling Smørgrav AuthorDate: 2026-07-06 12:23:55 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-07-21 08:55:00 +0000 libc/resolv: Dead code and style cleanup Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57928 (cherry picked from commit 4805b88edb009e53c4fee159138d2cbe0c848da7) --- lib/libc/resolv/res_init.c | 59 +++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c index fcf4eb4b0119..effd23d6cf7a 100644 --- a/lib/libc/resolv/res_init.c +++ b/lib/libc/resolv/res_init.c @@ -4,7 +4,7 @@ * Copyright (c) 1985, 1989, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 2026 Dag-Erling Smørgrav - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -32,14 +32,14 @@ /* * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -150,9 +150,8 @@ static int res_setsortlist(res_state, int, const char *, const char *); * Return 0 if completes successfully, -1 on error */ int -res_ninit(res_state statp) { - extern int __res_vinit(res_state, int); - +res_ninit(res_state statp) +{ return (__res_vinit(statp, 0)); } @@ -170,7 +169,6 @@ __res_vinit(res_state statp, int preinit) .sin_port = htons(NAMESERVER_PORT), .sin_addr = { htonl(INADDR_LOOPBACK) }, } }, -#ifdef HAS_INET6_STRUCTS { .sin6 = { .sin6_family = AF_INET6, #ifdef HAVE_SA_LEN @@ -179,7 +177,6 @@ __res_vinit(res_state statp, int preinit) .sin6_port = htons(NAMESERVER_PORT), .sin6_addr = IN6ADDR_LOOPBACK_INIT, } }, -#endif }; char *cp, **pp; int dots; @@ -209,7 +206,7 @@ __res_vinit(res_state statp, int preinit) statp->_u._ext.nscount = 0; statp->_u._ext.ext = malloc(sizeof(*statp->_u._ext.ext)); if (statp->_u._ext.ext != NULL) { - memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext)); + memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext)); statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr; strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa"); strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int"); @@ -861,7 +858,8 @@ res_rndinit(res_state statp) } u_int -res_nrandomid(res_state statp) { +res_nrandomid(res_state statp) +{ struct timeval now; u_int16_t u16; MD5_CTX ctx; @@ -891,10 +889,11 @@ res_nrandomid(res_state statp) { * This routine is not expected to be user visible. */ void -res_nclose(res_state statp) { +res_nclose(res_state statp) +{ int ns; - if (statp->_vcsock >= 0) { + if (statp->_vcsock >= 0) { (void) _close(statp->_vcsock); statp->_vcsock = -1; statp->_flags &= ~(RES_F_VC | RES_F_CONN); @@ -908,7 +907,8 @@ res_nclose(res_state statp) { } void -res_ndestroy(res_state statp) { +res_ndestroy(res_state statp) +{ res_nclose(statp); if (statp->_u._ext.ext != NULL) { free(statp->_u._ext.ext); @@ -921,22 +921,6 @@ res_ndestroy(res_state statp) { statp->options &= ~RES_INIT; } -#ifndef _LIBC -const char * -res_get_nibblesuffix(res_state statp) { - if (statp->_u._ext.ext) - return (statp->_u._ext.ext->nsuffix); - return ("ip6.arpa"); -} - -const char * -res_get_nibblesuffix2(res_state statp) { - if (statp->_u._ext.ext) - return (statp->_u._ext.ext->nsuffix2); - return ("ip6.int"); -} -#endif - void res_setservers(res_state statp, const union res_sockaddr_union *set, int cnt) { @@ -964,8 +948,6 @@ res_setservers(res_state statp, const union res_sockaddr_union *set, int cnt) statp->nsaddr_list[nserv].sin_family = 0; nserv++; break; - -#ifdef HAS_INET6_STRUCTS case AF_INET6: size = sizeof(set->sin6); if (statp->_u._ext.ext) @@ -978,8 +960,6 @@ res_setservers(res_state statp, const union res_sockaddr_union *set, int cnt) statp->nsaddr_list[nserv].sin_family = 0; nserv++; break; -#endif - default: break; } @@ -989,7 +969,8 @@ res_setservers(res_state statp, const union res_sockaddr_union *set, int cnt) } int -res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) { +res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) +{ int i; size_t size; u_int16_t family; @@ -997,7 +978,7 @@ res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) { for (i = 0; i < statp->nscount && i < cnt; i++) { if (statp->_u._ext.ext) family = statp->_u._ext.ext->nsaddrs[i].sin.sin_family; - else + else family = statp->nsaddr_list[i].sin_family; switch (family) { @@ -1011,8 +992,6 @@ res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) { memcpy(&set->sin, &statp->nsaddr_list[i], size); break; - -#ifdef HAS_INET6_STRUCTS case AF_INET6: size = sizeof(set->sin6); if (statp->_u._ext.ext) @@ -1023,8 +1002,6 @@ res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) { memcpy(&set->sin6, &statp->nsaddr_list[i], size); break; -#endif - default: set->sin.sin_family = 0; break; @@ -1033,5 +1010,3 @@ res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) { } return (statp->nscount); } - -/*! \file */