From patchwork Sun Jan 5 05:56:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 104048 Return-Path: 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 699A13858408 for ; Sun, 5 Jan 2025 06:10:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 699A13858408 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=Jg87prQX 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 0029F3858C78 for ; Sun, 5 Jan 2025 05:59:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0029F3858C78 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 0029F3858C78 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=1736056750; cv=none; b=JIO3EHOEncVMkFVO5hryuGA5jALx4WvF9od+0lSIYES5JhzcLqHHsjNLc31LEdzljYEwmunY0X2XqPBcVRY6voAqZ/fRPQJFJnSKKw7Z6+lrBwxYxDBeKiWuwOTcRN0xYlifsGCUuK2lQKksG8jYauewvwe09EffZgQeXjPwcMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736056750; c=relaxed/simple; bh=IZBgqVuZRULUUm03ZvcCHvDD+fAlVlwMV/6aLf6aohw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EGwbFZTJNCNmcAip7WY+U5UuD4EhnNxsaMp9RyKHDY+TT7JYFeVXWQeWeWwiu3bOx+rWZubQakjcVwrRBKQEwy8gIT0AOUVcSEzzs5faP4/WprRiFHxkiEisOKq368cvKxSApvEiipxWLYa5j1oAlsxFcnhQwbCAg5Kv7dENckU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0029F3858C78 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 7948C3C123845 for ; Sat, 4 Jan 2025 21:59:09 -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 il1E18O8WNIo; Sat, 4 Jan 2025 21:59:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 385833C123843; Sat, 4 Jan 2025 21:59:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 385833C123843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1736056749; bh=7lPz9ySSOTkms6DdeDgIP/a7FKFWqetfZWEBZL9tieg=; h=From:To:Date:Message-ID:MIME-Version; b=Jg87prQXPVZkLxJv5FN3Q/dvW2SHuOGPm8gUaUjN8pSWPuH+WHDksoL0IVcORR6LR RxjohdqM5KjJF9a8nuDTXUtkfb4+YiR1fWZQaSeSFAFGiTFPYfxLCFuKz6vP2wEe+V 1BoEEg3oHRbG68IO7Moh5ZV++vI02FyKkZ9SfuxFQwptQAc3SsU0PRxVPzqC9J4Gyc pd292y4f4Ng2uQwQjoMoEj5q6FjubWqI+HqO2N2Ru+sWOTI3SVADtpdQhcENL88meP nav3o0goavFIfDkhcBIRSHMKhRYpdhw3J2aDhOR+Sz2TuKQuUfdW7WPg9qqFpgbB1r 82v9/blUtYujw== 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 RpS3Vf8Ohvs8; Sat, 4 Jan 2025 21:59:09 -0800 (PST) Received: from wing.home (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 215B73C082EB9; Sat, 4 Jan 2025 21:59:09 -0800 (PST) From: Paul Eggert To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 22/59] __use_tzfile is boolean Date: Sat, 4 Jan 2025 21:56:57 -0800 Message-ID: <20250105055750.1668721-23-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 X-Spam-Status: No, score=-10.2 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org * time/tzfile.c (__use_tzfile): Now bool instead of int. --- time/tzfile.c | 8 ++++---- time/tzset.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/time/tzfile.c b/time/tzfile.c index dcd2bcc96d..8d8391acfe 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -33,7 +33,7 @@ #include -int __use_tzfile; +bool __use_tzfile; static dev_t tzfile_dev; static ino64_t tzfile_ino; static __time64_t tzfile_mtime; @@ -147,14 +147,14 @@ __tzfile_read (const char *file) union { struct tzhead tzhead; tzidx tzidx_aligned; } u; tzidx charcnt; tzidx i; - int was_using_tzfile = __use_tzfile; + bool was_using_tzfile = __use_tzfile; int trans_width = 4; char *new = NULL; _Static_assert (sizeof (__time64_t) == 8, "__time64_t must be eight bytes"); - __use_tzfile = 0; + __use_tzfile = false; if (file == NULL) /* No user specification; use the site-wide default. */ @@ -565,8 +565,8 @@ __tzfile_read (const char *file) __timezone = -rule_stdoff; done: - __use_tzfile = 1; free (new); + __use_tzfile = true; return; lose: diff --git a/time/tzset.h b/time/tzset.h index 8c87ad6a24..3687c044e3 100644 --- a/time/tzset.h +++ b/time/tzset.h @@ -8,7 +8,7 @@ /* Defined in tzset.c. */ extern char *__tzstring (const char *string) attribute_hidden; -extern int __use_tzfile attribute_hidden; +extern bool __use_tzfile attribute_hidden; extern void __tzfile_read (const char *file) attribute_hidden; extern void __tzfile_compute (__time64_t timer, int use_localtime,