From nobody Wed Oct 18 14:08:45 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 4S9Xl14Q5Mz4x4Bj; Wed, 18 Oct 2023 14:08:45 +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 4S9Xl13wMwz3FsH; Wed, 18 Oct 2023 14:08:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697638125; 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=nTNYMdCewWIohE85TJHG1/xNupwKAMPb3giu0UuN518=; b=brXFzpmli70kUnXiv+CY1TTRKPBDyU1NRF8BPFx4Cjky964Kq3EowT6ipYQFZhrOS80gUH qJKHjBNzSbXsy2KVbG7CjOywEiBaFVARY8HN3aWNTLcPz7+pbvt9ml6icpppp99Q1kyGrN EsQxzKylJOT1Gd+WBL2C57omGXY6cYU9uMi9r4WkQUg2EtzPLHOXjQbstpv0c5zpRIToRI 6eEOt0g7pLSSag581kyfwHr5cqqDbk6UUehIxkLQi5hJxIH//buCTaZGnF2xZW9hnu1vIr jfwsFPGJEfkA1LpT2fKTMvpHxTNK2gxfnH/FXbG/7P0f5PIzM14NuXNk5oYwpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697638125; a=rsa-sha256; cv=none; b=rIgsNTSoGWWqleNu1eG4uFRM/9GcxcEQ9FtS7WYbICG/JhmrWdZNl0UVTAm47yOYMugUaH VeNww/7kCgjxATe4Otos6rPhG718HkzmrU8nlfF/TlVNxpDjh7A9C4B43TKob12W8pCHgf EeWf5Bbv6ROHLYTxINKlx6V0KXFrz4tVKnavtAmdSjjxloeY1mrsJxLuw0eXZvuPlSP5SL rN92B3X73Rliafoc8ztseZGb/L0wZ4Xmsp+gG0sVJdsb4OvKr/d9suVgos1P4u1wlnWLEl ubZixulZsOSrfo6et3NucpYhYqTOZNWt9Z1a2vq6moBhqN7PWregaEI4HPMGnA== 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=1697638125; 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=nTNYMdCewWIohE85TJHG1/xNupwKAMPb3giu0UuN518=; b=HmIwxatIK4sCw4a+SSnEtgo4Tbk7h2dBUDLCKyywVHCKS6EgymU83V4FsV6R2yPbNDdNJo tt1GUUWQUBO4Uc+gDpFbBCrWk98Q/kU8TodGT4XHlWgP5kPAhdNVWFCRSWU4ctQlsBfrbP i8HtqnSjZiBxml4H/ieliYJwnE4yWlJ3R84jFyJFjy0rTKbl4NYRRSpluFFm0NXBfUF3c4 SxgsXTDyRfKolXbxIdp1lU9oOLWXZyXsE7xIOAu5LxsDbTH4Ho2+tRlpsrnGqMnW6bMBr/ 5c20SydiW5LkMSv5LbO/RiG7EJefs8tlglGJKDeuOFMr7jzlydDAiaEYeGmh1w== 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 4S9Xl12yyDz18Ww; Wed, 18 Oct 2023 14:08:45 +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 39IE8j6w040717; Wed, 18 Oct 2023 14:08:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39IE8jAm040714; Wed, 18 Oct 2023 14:08:45 GMT (envelope-from git) Date: Wed, 18 Oct 2023 14:08:45 GMT Message-Id: <202310181408.39IE8jAm040714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 64fc8a936c86 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 64fc8a936c868345a8f687fe2797474c5fcf35cb Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=64fc8a936c868345a8f687fe2797474c5fcf35cb commit 64fc8a936c868345a8f687fe2797474c5fcf35cb Author: Dag-Erling Smørgrav AuthorDate: 2023-10-18 14:05:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-10-18 14:05:55 +0000 hesiod: Modernize. Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D42190 --- 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 634f109e616b..421c3a4586d1 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; @@ -130,8 +129,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; @@ -221,10 +219,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; @@ -243,9 +238,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; @@ -263,9 +256,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]; @@ -357,9 +348,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; @@ -483,16 +472,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) @@ -506,9 +493,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; @@ -529,20 +514,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; @@ -556,7 +540,7 @@ init_context() } static void -translate_errors() +translate_errors(void) { switch (errno) { case ENOENT: