]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
musl: time-util: skip tm.tm_wday check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Sep 2025 06:08:49 +0000 (15:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Nov 2025 18:13:59 +0000 (03:13 +0900)
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

index 8e0d4cc03041809e5b9d58f709b99b38bad571c8..40d1bf1e090fdfedc9f869d8e89ca29b7215c3f3 100644 (file)
@@ -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;
         }