From nobody Wed Dec 13 20:06:28 2023 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 4Sr61x2NLdz54FVP; Wed, 13 Dec 2023 20:06:29 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61x1GCzz4Yyq; Wed, 13 Dec 2023 20:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497989; 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=IfhFUD+Dfyx8XfJhtojD6JLqrHDewht8YVavBSN2dg4=; b=Lny6+539kxFbFdvVVJkppW5z46HTSqEKNcZqtw348YDV/QZCKJOT/d4hXwpWo2JnVyi9ag P3mc+l4bIUzCRjhnKRG3CVEG4wpkVeA1ChWwAAwYRP9sglPFrMmSIngqTMsvjp35GSN7g4 3nboEkmfAi4OFgPrAvQf9yUrBzGn/UQH0Z2JrzlRENAimuUk6Xtoli4bp3Yx9xGqege8ys f2dmB/bIpKDv9SbVFEcdnWqh24scs33q2gZFj7DcVLH/TrCZmxz9SJ/q/QoahYTySyMXWB A92wH0Jdu9jmLt1VBHLPTGEmCy08Sr2OnKwJC5lTIvSYPcdZkgkTDvOBpbUoHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497989; a=rsa-sha256; cv=none; b=M8khSe/cEPSeAn40XJBfTat746FS6AY5uvCNgcp4wnuSMJoERxAQM+QbsUI5ACNzUQ3v/z /5vJGIm5Hobo18Sh5QrV6e868WxLiVcy/H3tygL/4cXWsiEZsPgk4UFCSP59trk0wyJt3c IRwfDrOnsRo6H/f1/WcUoKOKKV/0PrV8Ug/1+9SgCtGokzynyilYmi+I3aCZo823etMDc4 No6DHUEYqUnBj1mf8i9mVNUb5RirhadoDf3B1yTsVsUUbGd+3alWWqg3EFayBKzUvKdCi4 wfGOjgIBXg/KTsmRFLbZXueqx3tGA0H1BoO6GWrC6oVIB6EA3DX4/nwrEpmGDQ== 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=1702497989; 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=IfhFUD+Dfyx8XfJhtojD6JLqrHDewht8YVavBSN2dg4=; b=HjLkU8L9NNwazrX3JXLihx1KJ+S1vT+PSUmU1s3Q+5GXiLYySmzhQ+suaC6wS5VqNcCAlI u1c0KAQEem/6q4U6nQMNsXNHHPIv47103X4vXGTGqpIzwou+9OAWrbRI1BtkfWj7IfQeiD 2kaS87KrGt6mXm/tJJqS/2qWepxXJ/lHVdYwJMeur8ZkgHVJB29ypcxdvailBaYREsOlgC Iz0gHa9U614hH+mUL1qAAcWhVL/iCqwTh2bpk9ZkHEen6NDV2CazPpIYoxSvEmzfQ7q8wc 4ZF4rkmjDuKV3QzJVMgP6oMap/al+/hKi+3Gadc/OcAJsQXetL0qQ4/5Ftd6XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sr61x0MqSz1Bll; Wed, 13 Dec 2023 20:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6SuO087348; Wed, 13 Dec 2023 20:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6SV2087345; Wed, 13 Dec 2023 20:06:28 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:28 GMT Message-Id: <202312132006.3BDK6SV2087345@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: 064f91f65f82 - stable/13 - hesiod: Modernize. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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/13 X-Git-Reftype: branch X-Git-Commit: 064f91f65f82a486efc35c843d23d092e46204c8 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=064f91f65f82a486efc35c843d23d092e46204c8 commit 064f91f65f82a486efc35c843d23d092e46204c8 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-18 14:05:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:37 +0000 hesiod: Modernize. Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D42190 (cherry picked from commit 64fc8a936c868345a8f687fe2797474c5fcf35cb) --- lib/libc/net/hesiod.c | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index fbead770730f..14ed2c7ce641 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -81,8 +81,7 @@ static void translate_errors(void); * initialize a hesiod_p. */ int -hesiod_init(context) - void **context; +hesiod_init(void **context) { struct hesiod_p *ctx; const char *p, *configname; @@ -136,8 +135,7 @@ hesiod_init(context) * Deallocates the hesiod_p. */ void -hesiod_end(context) - void *context; +hesiod_end(void *context) { struct hesiod_p *ctx = (struct hesiod_p *) context; @@ -227,10 +225,7 @@ hesiod_to_bind(void *context, const char *name, const char *type) * by the resolver. */ char ** -hesiod_resolve(context, name, type) - void *context; - const char *name; - const char *type; +hesiod_resolve(void *context, const char *name, const char *type) { struct hesiod_p *ctx = (struct hesiod_p *) context; char *bindname, **retvec; @@ -249,9 +244,7 @@ hesiod_resolve(context, name, type) /*ARGSUSED*/ void -hesiod_free_list(context, list) - void *context; - char **list; +hesiod_free_list(void *context, char **list) { char **p; @@ -269,9 +262,7 @@ hesiod_free_list(context, list) * or ctx->rhs which need to be freed by the caller. */ static int -read_config_file(ctx, filename) - struct hesiod_p *ctx; - const char *filename; +read_config_file(struct hesiod_p *ctx, const char *filename) { char *key, *data, *p, **which; char buf[MAXDNAME + 7]; @@ -363,9 +354,7 @@ read_config_file(ctx, filename) * return a list of them. */ static char ** -get_txt_records(qclass, name) - int qclass; - const char *name; +get_txt_records(int qclass, const char *name) { HEADER *hp; unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor; @@ -489,16 +478,14 @@ static void *context; static int errval = HES_ER_UNINIT; int -hes_init() +hes_init(void) { init_context(); return errval; } char * -hes_to_bind(name, type) - const char *name; - const char *type; +hes_to_bind(const char *name, const char *type) { static char *bindname; if (init_context() < 0) @@ -512,9 +499,7 @@ hes_to_bind(name, type) } char ** -hes_resolve(name, type) - const char *name; - const char *type; +hes_resolve(const char *name, const char *type) { static char **list; @@ -535,20 +520,19 @@ hes_resolve(name, type) } int -hes_error() +hes_error(void) { return errval; } void -hes_free(hp) - char **hp; +hes_free(char **hp) { hesiod_free_list(context, hp); } static int -init_context() +init_context(void) { if (!inited) { inited = 1; @@ -562,7 +546,7 @@ init_context() } static void -translate_errors() +translate_errors(void) { switch (errno) { case ENOENT: