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:
parent
edb50f3398
commit
e5803f2a5d
@ -1,2 +1,2 @@
|
|||||||
SRC_DIR="sources"
|
SRC_DIR="sources"
|
||||||
TIS_PATCH_VER=8
|
TIS_PATCH_VER=9
|
||||||
|
@ -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
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
@ -167,7 +167,7 @@ bool fm_db_util_get_timestamp(const char *str, FMTimeT &ft){
|
|||||||
struct tm t;
|
struct tm t;
|
||||||
memset(&t, 0, sizeof(t));
|
memset(&t, 0, sizeof(t));
|
||||||
strptime(str, "%F %T", &t);
|
strptime(str, "%F %T", &t);
|
||||||
ts.tv_sec = mktime(&t);
|
ts.tv_sec = timegm(&t);
|
||||||
//now get the nanoseconds
|
//now get the nanoseconds
|
||||||
char *tstr = strdup(str);
|
char *tstr = strdup(str);
|
||||||
char *tobe_free = strsep(&tstr, ".");
|
char *tobe_free = strsep(&tstr, ".");
|
||||||
|
Loading…
Reference in New Issue
Block a user