Fix alarms issues on non-UTC systems

This fixes two issues
-Alarm clear time incorrectly reported on non-UTC systems.
-Paused instances do not display the correct alarm timestamp in
non-UTC systems.

The mktime call that's made in fm_db_util_get_timestamp uses the local
tz in it's calculation. It assumes the incoming time is also in the
local time. When mktime is provided with a value in UTC we see the error
presented in this bug.

Change-Id: Iaf8d097e2dfdfae585b6976e02a85b9e2f1b19f9
Closes-Bug: 1828448
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
This commit is contained in:
Kristine Bujold 2019-05-31 10:11:06 -04:00
parent edb50f3398
commit e5803f2a5d
2 changed files with 3 additions and 3 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="sources"
TIS_PATCH_VER=8
TIS_PATCH_VER=9

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2018 Wind River Systems, Inc.
// Copyright (c) 2014-2019 Wind River Systems, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
@ -167,7 +167,7 @@ bool fm_db_util_get_timestamp(const char *str, FMTimeT &ft){
struct tm t;
memset(&t, 0, sizeof(t));
strptime(str, "%F %T", &t);
ts.tv_sec = mktime(&t);
ts.tv_sec = timegm(&t);
//now get the nanoseconds
char *tstr = strdup(str);
char *tobe_free = strsep(&tstr, ".");