bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] timegm: desync from glibc for now


From: Paul Eggert
Subject: [PATCH 1/2] timegm: desync from glibc for now
Date: Fri, 4 Oct 2024 09:16:37 -0700

* config/srclist.txt: Omit time/timegm.c and time/mktime-internal.h
for now, until we can sync glibc from Gnulib.
* lib/mktime-internal.h, lib/timegm.c: Revert autoupdate, going
back to the recent Gnulib-specific version.
---
 ChangeLog             | 8 ++++++++
 config/srclist.txt    | 4 ++--
 lib/mktime-internal.h | 9 ++++-----
 lib/timegm.c          | 2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4316c1bed4..d8ec6067da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-10-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       timegm: desync from glibc for now
+       * config/srclist.txt: Omit time/timegm.c and time/mktime-internal.h
+       for now, until we can sync glibc from Gnulib.
+       * lib/mktime-internal.h, lib/timegm.c: Revert autoupdate, going
+       back to the recent Gnulib-specific version.
+
 2024-10-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        mktime: prefer static_assert to verify
diff --git a/config/srclist.txt b/config/srclist.txt
index dbf32d5246..173f23edaf 100644
--- a/config/srclist.txt
+++ b/config/srclist.txt
@@ -89,9 +89,9 @@ $LIBCSRC stdlib/tst-stdc_leading_zeros.c      tests/from-glibc
 $LIBCSRC stdlib/tst-stdc_trailing_ones.c       tests/from-glibc
 $LIBCSRC stdlib/tst-stdc_trailing_zeros.c      tests/from-glibc
 #$LIBCSRC sysdeps/generic/eloop-threshold.h    lib
-$LIBCSRC time/timegm.c                 lib
+#$LIBCSRC time/timegm.c                        lib
 #$LIBCSRC time/mktime.c                        lib
-$LIBCSRC time/mktime-internal.h                lib
+#$LIBCSRC time/mktime-internal.h       lib
 
 # 
 # All below here commented out in forlorn hope of future syncs.
diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h
index 0693aaf140..3e2848c121 100644
--- a/lib/mktime-internal.h
+++ b/lib/mktime-internal.h
@@ -71,9 +71,8 @@ typedef int mktime_offset_t;
 #endif
 
 /* Subroutine of mktime.  Return the time_t representation of TP and
-   normalize TP, given that a struct tm * maps to a time_t as performed
-   by FUNC.  Record next guess for localtime-gmtime offset in *OFFSET.  */
-extern __time64_t __mktime_internal (struct tm *tp,
-                                     struct tm *(*func) (__time64_t const *,
-                                                         struct tm *),
+   normalize TP, given that a struct tm * maps to a time_t.  If
+   LOCAL, the mapping is performed by localtime_r, otherwise by gmtime_r.
+   Record next guess for localtime-gmtime offset in *OFFSET.  */
+extern __time64_t __mktime_internal (struct tm *tp, bool local,
                                      mktime_offset_t *offset) attribute_hidden;
diff --git a/lib/timegm.c b/lib/timegm.c
index e5cf30c019..1f1f66c61b 100644
--- a/lib/timegm.c
+++ b/lib/timegm.c
@@ -31,7 +31,7 @@ __timegm64 (struct tm *tmp)
 {
   static mktime_offset_t gmtime_offset;
   tmp->tm_isdst = 0;
-  return __mktime_internal (tmp, __gmtime64_r, &gmtime_offset);
+  return __mktime_internal (tmp, false, &gmtime_offset);
 }
 
 #if defined _LIBC && __TIMESIZE != 64
-- 
2.43.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]