diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 40d1bf1e09..c612606a72 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(