[PATCH 22/59] __use_tzfile is boolean
Paul Eggert
eggert@cs.ucla.edu
Sun Jan 5 05:56:57 GMT 2025
* 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 <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,
--
2.45.2
More information about the Libc-alpha
mailing list