From nobody Tue Aug 26 00:25:01 2025 X-Original-To: dev-commits-src-branches@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 4c9pMd48MJz65tG3; Tue, 26 Aug 2025 00:25:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c9pMd3LXXz3kyN; Tue, 26 Aug 2025 00:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756167901; 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=NQvbUc9bKlpJzErdL3QgbtB/nnZ2vS15tvRDgXce9oY=; b=RHE9dboT9auKlFztRQN4HSm/VhJST1GE3v+vc1cpu8S3XGxuWRaBQ8SVUk5CZEZ9CPHnAG g2+8XP6eWKSeny5FdfF2Zg+8XUvUZLAFgIJOFUU5W8zvVT8juXFMcuKQiYjSTyCiWayljY zvndcbSAbNL61DYhW9IuvKWY9wU1qs9CSL4JgClW2r+hXegLGt4xK9Pc62ZKGF5lNjNav7 unQPqKA4aMSWA/g8qwRJyj4sVxPtTTXZ+ThHJMPOWiphx3hY6sidIJ6AGZ9wd8vxaAhGm8 OEP5F7DMwNDyHYtIAtvW7hoYiQNMgELR7qpz8X3YUF0QLrE5AddfnpbMwXD69w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756167901; 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=NQvbUc9bKlpJzErdL3QgbtB/nnZ2vS15tvRDgXce9oY=; b=yGcVspWG6Ec2nSj8YoSq38z3xIsuTN8g1xWXZi5hb7WLLcKyMgZdYAHuEIdArl11nsv+5m LW2GBnNfRLUFMPq9Ve4nW3wtUjkfpfBbmiFaO15tAY8EcJs2txP7Iy5QAJyLkLWoeg1g3v K9mUE2SyLg+ry9HX8CF9uXqw2eG7ybvtckmyPVlowm3dC2qZizvRnR2yrJzV6bXBty8QkW A79HcRRV+DIsTmDNd1Dsr2SWwG9rUAhbiZso3JCdy7o6uoT3qgxhcB69fOZeTtDXTM32KW 0RzQdPxltTzeTBEvDnut2OVai20qyi6QFMDO+6ie9bZzGVW3KGLAP3xMMVneLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756167901; a=rsa-sha256; cv=none; b=lPZ/qU8OwEbLT0RnzRAkBuQeLv3yRc/ginvC3HUkWH+ziZjVBJUb47z3JdyznqT3EmA/uh 2o2P0LdQ1fqdEQzQgVcCHC1xpAYYxRYGWyHJk+EX6JSgSyYffmYIAalhPvn2Re53eWHqIx H/WyefYvykVaWoZGUcFXM9C3eaRq0ixtpqwZxh/DqqTYXY74rroxr0iL6P46RMR6v3/FPF 5DNip6cm9S7n99yKMkxuWSvPAL/5vUUAQG7DBvrQsFQIt7c5sj2Dth91pxu5nI70gdF8gf 4p/5gpcGAHsaE8Q2O5KaWg2rzfreK8AL8+yAqSsGSZFptavO7JPIMQxKLG7TlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4c9pMd2nyzz1Bq7; Tue, 26 Aug 2025 00:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57Q0P1LG071310; Tue, 26 Aug 2025 00:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57Q0P1fe071307; Tue, 26 Aug 2025 00:25:01 GMT (envelope-from git) Date: Tue, 26 Aug 2025 00:25:01 GMT Message-Id: <202508260025.57Q0P1fe071307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5e243ccc5f67 - stable/14 - libc: preserve errno in gai_strerror() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5e243ccc5f67229582f6e6cbfbaee834adb7cdae Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5e243ccc5f67229582f6e6cbfbaee834adb7cdae commit 5e243ccc5f67229582f6e6cbfbaee834adb7cdae Author: Konstantin Belousov AuthorDate: 2025-08-19 03:05:37 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-26 00:23:31 +0000 libc: preserve errno in gai_strerror() PR: 288931 (cherry picked from commit f892e509c1a07f7116b9788a05e4ae99a06d54d0) --- lib/libc/net/gai_strerror.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/net/gai_strerror.c b/lib/libc/net/gai_strerror.c index 96bc32b593fa..23f58b763573 100644 --- a/lib/libc/net/gai_strerror.c +++ b/lib/libc/net/gai_strerror.c @@ -82,7 +82,9 @@ gai_strerror(int ecode) #if defined(NLS) nl_catd catd; char *buf; + int saved_errno; + saved_errno = errno; if (thr_main() != 0) buf = gai_buf; else { @@ -110,9 +112,11 @@ gai_strerror(int ecode) strlcpy(buf, catgets(catd, 3, NL_MSGMAX, "Unknown error"), sizeof(gai_buf)); catclose(catd); + errno = saved_errno; return (buf); thr_err: + errno = saved_errno; #endif if (ecode >= 0 && ecode < EAI_MAX) return (ai_errlist[ecode]);