uClibc-0.9.31.1-fix-daylight-saving-time-handling.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 47f3da1cf49377c25772bb54d07db55225bbb142 Mon Sep 17 00:00:00 2001
  2. From: Guillaume Bourcier <guillaumebourcier@free.fr>
  3. Date: Tue, 11 Oct 2011 13:45:33 +0200
  4. Subject: [PATCH] libc: fix daylight saving time handling
  5. The algorithm computing daylight saving time incorrectly adds a day for
  6. each month after January for leap years. The clock shift from/to DST can
  7. be delayed if the last Sunday of a transition month is exactly seven
  8. days before the first of the following month.
  9. This change adds a day for the February month only.
  10. Signed-off-by: Guillaume Bourcier <guillaumebourcier@free.fr>
  11. Signed-off-by: Richard Braun <rbraun@sceen.net>
  12. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
  13. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  14. ---
  15. libc/misc/time/time.c | 2 +-
  16. 1 files changed, 1 insertions(+), 1 deletions(-)
  17. diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
  18. index 19d68e1..8e2ebf1 100644
  19. --- a/libc/misc/time/time.c
  20. +++ b/libc/misc/time/time.c
  21. @@ -689,7 +689,7 @@ static int tm_isdst(register const struct tm *__restrict ptm,
  22. ++day;
  23. }
  24. monlen = 31 + day_cor[r->month -1] - day_cor[r->month];
  25. - if (isleap && (r->month > 1)) {
  26. + if (isleap && (r->month == 2)) {
  27. ++monlen;
  28. }
  29. /* Wweekday (0 is Sunday) of 1st of the month
  30. --
  31. 1.7.3.4