Date: Tue, 21 Jul 2026 08:56:51 +0000 From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 899cf5932678 - stable/14 - libc/resolv: Drop Solaris 2 compatibility Message-ID: <6a5f3453.2211f.e703304@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=899cf5932678fc5a9572584d64e82e22569bee42 commit 899cf5932678fc5a9572584d64e82e22569bee42 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-07-06 12:23:24 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-07-21 08:54:59 +0000 libc/resolv: Drop Solaris 2 compatibility MFC after: 1 week Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D57922 (cherry picked from commit aba9fffebf97d631f85e904813ff35ed031a3bac) --- lib/libc/nameser/ns_parse.c | 5 ----- lib/libc/resolv/res_comp.c | 11 ----------- lib/libc/resolv/res_init.c | 42 ------------------------------------------ 3 files changed, 58 deletions(-) diff --git a/lib/libc/nameser/ns_parse.c b/lib/libc/nameser/ns_parse.c index c3c0fc02a10f..b40146d1608a 100644 --- a/lib/libc/nameser/ns_parse.c +++ b/lib/libc/nameser/ns_parse.c @@ -41,12 +41,7 @@ static void setsection(ns_msg *msg, ns_sect sect); /* Macros. */ -#if !defined(SOLARIS2) || defined(__COVERITY__) #define RETERR(err) do { errno = (err); return (-1); } while (0) -#else -#define RETERR(err) \ - do { errno = (err); if (errno == errno) return (-1); } while (0) -#endif #define PARSE_FMT_PRESO 0 /* Parse using presentation-format names */ #define PARSE_FMT_WIRE 1 /* Parse using network-format names */ diff --git a/lib/libc/resolv/res_comp.c b/lib/libc/resolv/res_comp.c index c60e81473ce8..c416af05378c 100644 --- a/lib/libc/resolv/res_comp.c +++ b/lib/libc/resolv/res_comp.c @@ -244,17 +244,6 @@ res_dnok(const char *dn) { * Note that one _ comes from C and the others come from us. */ -#ifdef SOLARIS2 -#ifdef __putlong -#undef __putlong -#endif -#ifdef __putshort -#undef __putshort -#endif -#pragma weak putlong = __putlong -#pragma weak putshort = __putshort -#endif /* SOLARIS2 */ - void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); } void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); } #ifndef __ultrix__ diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c index 496a9056da6d..a769d7b19395 100644 --- a/lib/libc/resolv/res_init.c +++ b/lib/libc/resolv/res_init.c @@ -112,10 +112,6 @@ static const char rcsid[] = "$Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Ex #include "res_private.h" -#ifdef SOLARIS2 -#include <sys/systeminfo.h> -#endif - static void res_setoptions(res_state, const char *, const char *); #ifdef RESOLVSORT @@ -238,28 +234,6 @@ __res_vinit(res_state statp, int preinit) { #endif res_setservers(statp, u, nitems(u)); -#ifdef SOLARIS2 - /* - * The old libresolv derived the defaultdomain from NIS/NIS+. - * We want to keep this behaviour - */ - { - char buf[sizeof(statp->defdname)], *cp; - int ret; - - if ((ret = sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf))) > 0 && - (unsigned int)ret <= sizeof(buf)) { - if (buf[0] == '+') - buf[0] = '.'; - cp = strchr(buf, '.'); - cp = (cp == NULL) ? buf : (cp + 1); - strncpy(statp->defdname, cp, - sizeof(statp->defdname) - 1); - statp->defdname[sizeof(statp->defdname) - 1] = '\0'; - } - } -#endif /* SOLARIS2 */ - /* Allow user to override the local domain definition */ if ((cp = secure_getenv("LOCALDOMAIN")) != NULL) { (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); @@ -599,22 +573,6 @@ res_setoptions(res_state statp, const char *options, const char *source) if (statp->options & RES_DEBUG) printf(";;\ttimeout=%d\n", statp->retrans); #endif -#ifdef SOLARIS2 - } else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) { - /* - * For backward compatibility, 'retrans' is - * supported as an alias for 'timeout', though - * without an imposed maximum. - */ - statp->retrans = atoi(cp + sizeof("retrans:") - 1); - } else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){ - /* - * For backward compatibility, 'retry' is - * supported as an alias for 'attempts', though - * without an imposed maximum. - */ - statp->retry = atoi(cp + sizeof("retry:") - 1); -#endif /* SOLARIS2 */ } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){ i = atoi(cp + sizeof("attempts:") - 1); if (i <= RES_MAXRETRY)home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a5f3453.2211f.e703304>
