[22/59] __use_tzfile is boolean

Message ID 20250105055750.1668721-23-eggert@cs.ucla.edu (mailing list archive)
State New
Headers
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 (__use_tzfile): Now bool instead of int.
---
 time/tzfile.c | 8 ++++----
 time/tzset.h  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
  

Patch

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 <timezone/tzfile.h>
 
-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,