arrfab / rpms / libreport

Forked from rpms/libreport 5 years ago
Clone

Blame SOURCES/0002-lib-Explicitly-do-not-use-DST.patch

Johnny Hughes ccdedf
From a5fbbd2fca0c8cd2a3c0c9a898dca37addf4b2e0 Mon Sep 17 00:00:00 2001
Johnny Hughes ccdedf
From: Matej Marusak <mmarusak@redhat.com>
Johnny Hughes ccdedf
Date: Thu, 6 Dec 2018 11:59:56 +0100
Johnny Hughes ccdedf
Subject: [PATCH 2/2] lib: Explicitly do not use DST
Johnny Hughes ccdedf
Johnny Hughes ccdedf
DST = Daylight Saving Time
Johnny Hughes ccdedf
Value of this field is not set up by strptime and therefore value
Johnny Hughes ccdedf
of `tm_isdst` field is undefined. Bacause of this reason, output of
Johnny Hughes ccdedf
`mktime` may differ +-1 hour.
Johnny Hughes ccdedf
Johnny Hughes ccdedf
Signed-off-by: Matej Marusak <mmarusak@redhat.com>
Johnny Hughes ccdedf
(cherry picked from commit bd7b93d056d780df18b377f5c553611deeff2443)
Johnny Hughes ccdedf
---
Johnny Hughes ccdedf
 src/lib/iso_date_string.c | 3 +++
Johnny Hughes ccdedf
 1 file changed, 3 insertions(+)
Johnny Hughes ccdedf
Johnny Hughes ccdedf
diff --git a/src/lib/iso_date_string.c b/src/lib/iso_date_string.c
Johnny Hughes ccdedf
index ab23f05b..cb887832 100644
Johnny Hughes ccdedf
--- a/src/lib/iso_date_string.c
Johnny Hughes ccdedf
+++ b/src/lib/iso_date_string.c
Johnny Hughes ccdedf
@@ -61,6 +61,9 @@ int iso_date_string_parse(const char *date, time_t *pt)
Johnny Hughes ccdedf
         return -EINVAL;
Johnny Hughes ccdedf
     }
Johnny Hughes ccdedf
 
Johnny Hughes ccdedf
+    // daylight saving time not in use
Johnny Hughes ccdedf
+    local.tm_isdst = 0;
Johnny Hughes ccdedf
+
Johnny Hughes ccdedf
     *pt = mktime(&local);
Johnny Hughes ccdedf
     return 0;
Johnny Hughes ccdedf
 }
Johnny Hughes ccdedf
-- 
Johnny Hughes ccdedf
2.21.0
Johnny Hughes ccdedf