From 8d5b306bb9901c7744bd79c7ceb38dcd93a48743 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 8 Sep 2025 15:08:49 +0900 Subject: [PATCH] musl: time-util: skip tm.tm_wday check musl does not set tm_wday when it is explicitly requested. The check is not necessary at all, it is just for safety. Let's skip it when built with musl. --- src/basic/time-util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 8e0d4cc0304..40d1bf1e090 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -889,7 +889,11 @@ static int parse_timestamp_impl( if (!k || *k != ' ') continue; +#ifdef __GLIBC__ + /* musl does not set tm_wday field and set 0 unless it is explicitly requested by %w or so. + * In the below, let's only check tm_wday field only when built with glibc. */ weekday = day->nr; +#endif t = k + 1; break; } -- 2.47.3