HomeFreeBSD

tzcode: Fix time zone change detection.

Description

tzcode: Fix time zone change detection.

Prior to the 2022g import, tzloadbody() returned -1 on error. Now it
returns an errno code. When I updated the time zone change detection
logic to match, I improperly returned errno in all cases, which means
that if the time zone file has not changed since we last loaded it,
tzloadbody() returns a random errno value instead of 0.

Fixes: bc42155199b5
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51405

(cherry picked from commit d63ffdd1ef6368407b35d415237b95cc739d8073)

tzcode: Add an explicit "the timezone file has changed" case

This is required for the WITHOUT_DETECT_TZ_CHANGES case, since there the
value being tested is a numeric literal.

Fixes: d63ffdd1ef63 ("tzcode: Fix time zone change detection.")
(cherry picked from commit 0bf113e9041fe20e8c671fe6b2cca8612dc77b77)

Details

Provenance
desAuthored on Jul 18 2025, 5:48 PM
Reviewer
markj
Differential Revision
D51405: tzcode: Fix time zone change detection.
Parents
rG99dfaac790a3: udf: Improve input validation.
Branches
Unknown
Tags
Unknown