From 6dd412bc50b14274a37f5e0d89efdd534518eeaf Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 12 Nov 2025 21:53:41 +0100 Subject: [PATCH] time-util: do not carry musl-specific fallback logic on glibc systems Follow-up for 3ac4d68498dd378e2b3acd2bb86f4700263532d0 We have no sensible way to detect why strptime() fails, hence the fallback path as it is now would fire on glibc systems too, pointlessly. Let's guard it behind ifdeffery. --- src/basic/time-util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 40d1bf1e090..c612606a72a 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -634,8 +634,6 @@ const char* get_tzname(bool dst) { } int parse_gmtoff(const char *t, long *ret) { - int r; - assert(t); struct tm tm; @@ -647,6 +645,11 @@ int parse_gmtoff(const char *t, long *ret) { return 0; } +#ifdef __GLIBC__ + return -EINVAL; +#else + int r; + /* musl v1.2.5 does not support %z specifier in strptime(). Since * https://github.com/kraj/musl/commit/fced99e93daeefb0192fd16304f978d4401d1d77 * %z is supported, but it only supports strict RFC-822/ISO 8601 format, that is, 4 digits with sign @@ -714,6 +717,7 @@ finalize: } return 0; +#endif } static int parse_timestamp_impl( -- 2.47.3