From nobody Thu Oct 2 08:20:41 2025 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 4ccl9P6bwsz69KX8; Thu, 02 Oct 2025 08:20:41 +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 4ccl9P5BlLz4MxY; Thu, 02 Oct 2025 08:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393241; 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=scKFyn18xstHD5ER67/fV7/khhsqs5ljm+dkswwyhM0=; b=xh22ToX773thyu5vB7FxL0YYA/LUR/d80TY4AFopmy3XlGH80jGSdYYD3Eh5CuxeqWZYta pCJjZeGdfcU/lNVguXG4s6na86vlwqzFYZ1xYzKaq6EWMdWefrCJA37DV/GjO+YqwY2zgL OQ/TShkwbFDmPOPGAQq/CChCEXEWb8hojYpu0UuyhGZXVITC/jOg7373fKUHkre3WetJmY 4w4+uzGrzKzupZY1Yo432rnEbiwDN0TkuOKybqRykR8iPAtSqB3IvcDVObNUWixMOZjGoS DQMQgvQMJC2wD8j4FQ7KEeeYC8g8bxeg1lTE+r1x0S1YMk2Lj0qWqlX1p1tK+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393241; 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=scKFyn18xstHD5ER67/fV7/khhsqs5ljm+dkswwyhM0=; b=j/XJ8z/Wa72vfv7aPpCWwlQiuGqzp9s6NldcrqZIlq0oVPChW5jIqBFSCWHt03a5z+bNyE +0moejeeV/0j95N1/q2+RXOPhcQzgJrLoUxAsJLnJ5HbEFeUVggTr50uszn3Z8i1uIhwMN OpTayYR0yxE3A8YGEeAHBQeBcFYEViefxg5/5BM2oTM86OpgyuyumIXNt3F4eRFjxqOVYQ khRJj0qT1WPIqhFJBf19bK3ONiUbo1K/l+bwZ3TVpLWC7b4O0YhszZJbjLDuFijaCgZ2FN hqXphLCu3pAGO6mIFEb2Wdu9ARVj4RPEVkXyVDtiAUWfJKFd0RNKdQZrMIKkcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393241; a=rsa-sha256; cv=none; b=nl2WnUR0cwETRxBkdhVv2nkr5ojPC/yX54IOv7LuOalFwYZsuQpf1lxjBeyrZIHlg1Pak5 l5X3woXNV+OCtizGjADea14cXATpyhgXJZqVFqLWksasazJfCwo8t86I+Ew53sApUNIj96 9OVrMKS7/JxIv5b/XVMx/0hJEksySvk5mAuUtCDO+RrH4d/9g5E/702P6p6eXQLaGZsks5 DjKlt0vDsmsN9Lhhxi0CQklX22ml1MHp4DueDbrhz2bSmhA3WqPO75oVTXG78ece3sOvbY iUtSP0mY6tczinHtPQdNjxXXZkI2jprix1QGk4LoXH+h7Gem0yDwdsTUETGJpQ== 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 4ccl9P4fKBz103J; Thu, 02 Oct 2025 08:20:41 +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 5928Kfa2023078; Thu, 2 Oct 2025 08:20:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Kfd9023075; Thu, 2 Oct 2025 08:20:41 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:41 GMT Message-Id: <202510020820.5928Kfd9023075@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: 89e460f6c013 - stable/15 - tzcode: Use -00 only for invalid time zones 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/15 X-Git-Reftype: branch X-Git-Commit: 89e460f6c013e5930b75372766be1096b7a02359 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=89e460f6c013e5930b75372766be1096b7a02359 commit 89e460f6c013e5930b75372766be1096b7a02359 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:56:11 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:23 +0000 tzcode: Use -00 only for invalid time zones As of tzcode 2025a, if we are unable to load a time zone, we set tzname to "-00" to indicate an error. This penalizes users who simply don't set TZ or create /etc/localtime as a faster way of setting the time zone to UTC (pointing /etc/localtime at /usr/share/zoneinfo/UTC forces us to parse it every time for no real benefit). To rectify this, use "-00" only if TZ was set or zoneinit() returned something else than ENOENT. MFC after: 3 days Fixes: 967a49a21a27 ("Update tzcode to 2025b") Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D52680 (cherry picked from commit a5f14e4f9069a8ffed66d923bb0ecf20d8a0e6af) --- contrib/tzcode/localtime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 15afeeecb6d0..7ba72d730648 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1649,9 +1649,13 @@ tzset_unlocked_name(char const *name) lclptr = sp = malloc(sizeof *lclptr); # endif if (sp) { - if (zoneinit(sp, name, TZLOAD_FROMENV | TZLOAD_TZSTRING) != 0) { + int err = zoneinit(sp, name, TZLOAD_FROMENV | TZLOAD_TZSTRING); + if (err != 0) { zoneinit(sp, "", 0); - strcpy(sp->chars, UNSPEC); + /* Abbreviate with "-00" if there was an error. + Do not treat a missing TZDEFAULT file as an error. */ + if (name || err != ENOENT) + strcpy(sp->chars, UNSPEC); } if (0 < lcl) strcpy(lcl_TZname, name);