Message ID | 20250105055750.1668721-12-eggert@cs.ucla.edu (mailing list archive) |
---|---|
State | New |
Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 145263858C56 for <patchwork@sourceware.org>; Sun, 5 Jan 2025 06:03:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 145263858C56 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C header.b=rObAA0uj X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id 438863858CDA for <libc-alpha@sourceware.org>; Sun, 5 Jan 2025 05:58:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 438863858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 438863858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=131.179.128.66 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736056722; cv=none; b=GAntke9kzYhQ3BDxsq5aJxCT90pFbI8r1+ZUjQUV06FOW/W/obn/h54sdx8l0Y4cMUc/4L+rGFryVlC3t8MA3PVlEFRtrZ3Lrb5qpXawtOvUJetjoM7XZjoRAdYhxppgIIRAK7Ea4O1T5/vY3om9t9mslDetcZdSOYoHhIvs5Sg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736056722; c=relaxed/simple; bh=WqaK9CXZnOzdjH1OJ0EqCDb7Ml2EWHTOHwNAzF7S2hc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sh+xiTfa+KjyPHtspF0ygRoVECLgxL0X4xxoQEmcOH9cRLbwijXh7Ap4EfMIqHgkX8jtjY0U74UopVDSJO/EXpREio0DNyG9XamELwOemaVZJCHH6YON+EVPro4rf8VzImMB+LpatrMWD9kmpsm1M7dvKuR/H3ZDjUbH7eJgVTI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 438863858CDA Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id BD4E53C123845 for <libc-alpha@sourceware.org>; Sat, 4 Jan 2025 21:58:41 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id 6Ht1cF5ih7PU; Sat, 4 Jan 2025 21:58:41 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 7DC8C3C123843; Sat, 4 Jan 2025 21:58:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 7DC8C3C123843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1736056721; bh=8n1iMLK+w8z+peljK47e7gzRU45N4i/h/eH+CD72eC8=; h=From:To:Date:Message-ID:MIME-Version; b=rObAA0ujw4cREIJv3/+TTlOLYKYQwBcELepSqQHOuj/szhTbN7bE2p176q0uCBBTR 9yOpRFUq7TlR06XRcMxmzc6H9D/K3Svt4IIOTZVDLg+OKKkxjrsENIp9lhKdZvLLgC hLNkRr64Jf7uAijqE2iv+Ge6TtXEnc6jhUz/BHT+az/6sjP8mOXxUN7SimKJ0rMGIN MOSsSZo/SXZLCR0vXTx38/7lZ1cQy9PYnC2fHCbKMZKhinlvL5qdd1WGvF4hjAvRNs wW8l531Oqk+rxQypgJg4knoyg/X+Qm56tU9E8wLAtglEPKopHtaG0DsYX+MenUzujU Thp/5ouOWvbvw== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id qL6tQ4KrclXA; Sat, 4 Jan 2025 21:58:41 -0800 (PST) Received: from wing.home (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 670563C082EB9; Sat, 4 Jan 2025 21:58:41 -0800 (PST) From: Paul Eggert <eggert@cs.ucla.edu> To: libc-alpha@sourceware.org Cc: Paul Eggert <eggert@cs.ucla.edu> Subject: [PATCH 11/59] tzset no longer calls ftello Date: Sat, 4 Jan 2025 21:56:46 -0800 Message-ID: <20250105055750.1668721-12-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.45.2 In-Reply-To: <01207110-bd60-46ae-9c08-fb39c2011067@cs.ucla.edu> References: <01207110-bd60-46ae-9c08-fb39c2011067@cs.ucla.edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
Series |
time: sync mktime from Gnulib
|
|
Checks
Context | Check | Description |
---|---|---|
redhat-pt-bot/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Paul Eggert
Jan. 5, 2025, 5:56 a.m. UTC
* time/tzfile.c (__tzfile_read): Compute file offset directly rather than invoking ftello. --- time/tzfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/time/tzfile.c b/time/tzfile.c index 9d5f428f47..15d1890892 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -168,6 +168,7 @@ __tzfile_read (const char *file) f = fopen (file, "rce"); if (f == NULL) goto ret_free_transitions; + off_t f_offset = 0; /* Get information about the file we are actually using. */ if (__fstat64_time64 (__fileno (f), &st) != 0) @@ -190,6 +191,7 @@ __tzfile_read (const char *file) || memcmp (tzhead.tzh_magic, TZ_MAGIC, sizeof (tzhead.tzh_magic)) != 0) goto lose; + f_offset += sizeof tzhead; num_transitions = (size_t) decode (tzhead.tzh_timecnt); num_types = (size_t) decode (tzhead.tzh_typecnt); chars = (size_t) decode (tzhead.tzh_charcnt); @@ -215,6 +217,7 @@ __tzfile_read (const char *file) if (fseek (f, to_skip, SEEK_CUR) != 0) goto lose; + f_offset += to_skip; goto read_again; } @@ -223,7 +226,7 @@ __tzfile_read (const char *file) size_t tzspec_len; if (trans_width == 8) { - off_t rem = st.st_size - __ftello (f); + off_t rem = st.st_size - f_offset; if (__builtin_expect (rem < 0 || (size_t) rem < (num_transitions * (8 + 1) + num_types * 6