eina_value_util: fix time_t value for aarch64 13/279013/2
authorHubert Stachowiak <h.stachowiak@samsung.com>
Fri, 29 Jul 2022 09:29:35 +0000 (11:29 +0200)
committerChun <jykeon@samsung.com>
Mon, 1 Aug 2022 03:32:58 +0000 (03:32 +0000)
On aarch64 mktime was returning -1 due to daylight saving time flag not being set in the struct tm. The struct is initialized with 0s and the flag is set to -1 (not available)

Change-Id: Id5958ad5769eaf53d3db571e34e07a7fd1bbd122

src/lib/eina/eina_value_util.c

index 05c7991..f14846b 100644 (file)
@@ -89,10 +89,11 @@ EAPI Eina_Value *
 eina_value_util_time_string_new(const char *timestr)
 {
    Eina_Value *v;
-   struct tm tm;
+   struct tm tm = {0};
    time_t t;
 
    if (!strptime(timestr, "%Y%m%dT%H:%M:%S", &tm)) return NULL;
+   tm.tm_isdst = -1; // Set daylight saving time flag to not available
    t = mktime(&tm);
    v = eina_value_new(EINA_VALUE_TYPE_TIMESTAMP);
    if (v) eina_value_set(v, t);