From nobody Tue Feb 14 22:20:25 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 4PGbHs6jS9z3q4vX; Tue, 14 Feb 2023 22:20:25 +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 4PGbHs692jz4J2b; Tue, 14 Feb 2023 22:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676413225; 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=4+GOYWG1Q85paX2IC6pw1JvJ5Bnm8aDyaU34Nss/Caw=; b=O5bbvfgRrn9WT8Fvty4EYt+veutMG6EmPWFo7qDtY0K9nwmrkjFeEPlnIvoHMy8KxqfFxi rGhS/LOcGlTKGHUg3meM8CSdWA/xlfw4dNX0AvqW/li9f7JA8E9AVnkrOS5Ycig4VAhNuS 6s0rYBcuapD1E/s9vDbkj6zXicq482+3Ak2qgwqKj9eVMBWLnAWhsnxDRtu0Hyq+Ltyh52 4uxtHQpUpXgPP747uEptfRTXD7MQrvKpeprFHDjcnvfBs87c4AmDMs8p8wpL8lbTpNmbWV aTdkEDU0+XlXai78FNHCxeMvDQqNSmdrFGbVgL5wZ3irdIeEOYzHB5TSu1tPpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676413225; 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=4+GOYWG1Q85paX2IC6pw1JvJ5Bnm8aDyaU34Nss/Caw=; b=Q1J/OCrRRGqxn0Dku5yQsvhzPbTE/XZqIf5AV3PVnqVdJ+GNX+vDQcNxDh5WKt3yhPJ1gS iEDkMpEv+TcwD6pDqzhhNWKqN8xBvc1c/rdq+4F3gNj6+WMOIFE7ILL02w9twDYJlx2bwK tvsaT9CO0UusX3ZoIA5lWwj6HbToZO0FAPUh2E0ont0POXY1Qb6njA4QxK8Dg5gxcBxFOW EUGGPpgMDGi5gWoQqdoQyFmx0yXMpoo+5MLGNlSyC0/PDWgeHsKc5qDg2p9+iSWXxEZoEu V/4AZchkBG8axUhWDFiyp5ULmmjVM+iQhEV5i20VAEMokgZozef9Onk4wNQnVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676413225; a=rsa-sha256; cv=none; b=VvfuAIUbuaqD09ongAlKBQwBVGj6CwfVhDiMAb+alcIYGqSY3yxzm6KfFhVgj4YS0EyVa3 tkXpZ0r6EeH5d575rCuzwXhywVt122rHD0JShvAr9CoaFLdJTyzCnLAjcsjc6qtHq2aagI ree4brK1txjb6G4MZxwIp7xfMvMn0LBgEFG7HzGEjW2mbsrnA432wYwagS0evNrCx+CqYo VP4W1u0YeSVUMQbrA1R9gh8P8uxqlFaGZZrn6Sx7KRqEHG7EEDyiShdFjiQeRxXLQe3Ele gOWiPzfKd7VpwxBqZaOYnEJQmOUuwISSzy0O7YjBCIqThuw3JcgNgOsN78L7eQ== 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 4PGbHs53vnz1Fg0; Tue, 14 Feb 2023 22:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31EMKPxa027200; Tue, 14 Feb 2023 22:20:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EMKPcB027199; Tue, 14 Feb 2023 22:20:25 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:20:25 GMT Message-Id: <202302142220.31EMKPcB027199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: b158a379d271 - releng/13.2 - tzcode: Resurrect tzsetwall(3) with a deprecation warning. 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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: b158a379d2716d55e59978b970c146ff5284f36c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b158a379d2716d55e59978b970c146ff5284f36c commit b158a379d2716d55e59978b970c146ff5284f36c Author: Dag-Erling Smørgrav AuthorDate: 2023-02-09 18:35:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-14 22:19:53 +0000 tzcode: Resurrect tzsetwall(3) with a deprecation warning. This function has been around since 4.4BSD but was dropped upstream in 2020. This went unnoticed when tzcode was updated. Bring it back, but prepare for removing it before 14.0 is released. PR: 269445 MFC after: 3 days Reported by: val@packett.cool Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38445 Approved by: re (cperciva) (cherry picked from commit 71e0c8906e1a4ff774f8ae810aeb94af039eedb7) (cherry picked from commit eab9ed3d48e0842f3114d8582a4c2868a354190b) --- contrib/tzcode/localtime.c | 21 +++++++++++++++++++-- lib/libc/gen/tzset.3 | 14 +++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 1b52e26a5faf..a8beaf47319a 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1517,9 +1517,8 @@ zoneinit(struct state *sp, char const *name) } static void -tzset_unlocked(void) +tzset_unlocked_name(char const *name) { - char const *name = getenv("TZ"); struct state *sp = lclptr; int lcl = name ? strlen(name) < sizeof lcl_TZname : -1; if (lcl < 0 @@ -1541,6 +1540,12 @@ tzset_unlocked(void) lcl_is_set = lcl; } +static void +tzset_unlocked(void) +{ + tzset_unlocked_name(getenv("TZ")); +} + void tzset(void) { @@ -1550,6 +1555,18 @@ tzset(void) unlock(); } +void +freebsd13_tzsetwall(void) +{ + if (lock() != 0) + return; + tzset_unlocked_name(NULL); + unlock(); +} +__sym_compat(tzsetwall, freebsd13_tzsetwall, FBSD_1.0); +__warn_references(tzsetwall, + "warning: tzsetwall() is deprecated, use tzset() instead."); + static void gmtcheck(void) { diff --git a/lib/libc/gen/tzset.3 b/lib/libc/gen/tzset.3 index ddeb40585f33..788a6259b727 100644 --- a/lib/libc/gen/tzset.3 +++ b/lib/libc/gen/tzset.3 @@ -31,7 +31,7 @@ .\" @(#)tzset.3 8.2 (Berkeley) 11/17/93 .\" $FreeBSD$ .\" -.Dd November 17, 1993 +.Dd February 8, 2023 .Dt TZSET 3 .Os .Sh NAME @@ -102,10 +102,14 @@ is used. .Pp The .Fn tzsetwall -function -sets things up so that -.Xr localtime 3 -returns the best available approximation of local wall clock time. +function is equivalent to calling +.Fn tzset +with the +.Ev TZ +environment variable unset. +It is deprecated and may not be available in +.Fx 14.0 +and later. .Sh SPECIFICATION FORMAT When .Ev TZ