diff options
author | sanghyeok.oh <sanghyeok.oh@samsung.com> | 2019-10-18 09:46:12 +0900 |
---|---|---|
committer | sanghyeok.oh <sanghyeok.oh@samsung.com> | 2019-10-18 09:47:59 +0900 |
commit | 8e88f4f5668504d9c42c651b15bbba285cfee1a1 (patch) | |
tree | 5ac640671bbecd86bf29189edffc3bfdd6d94c20 | |
parent | bf7fd13b2191ffd0d5a2b17afcd750d8cc648754 (diff) | |
download | resourced-accepted/tizen_5.5_unified.tar.gz resourced-accepted/tizen_5.5_unified.tar.bz2 resourced-accepted/tizen_5.5_unified.zip |
svace fixtizen_5.5.m2_releasesubmit/tizen_5.5_wearable_hotfix/20201026.184304submit/tizen_5.5_mobile_hotfix/20201026.185104submit/tizen_5.5/20191031.000004submit/tizen/20191018.084730accepted/tizen/unified/20191018.152357accepted/tizen/5.5/unified/wearable/hotfix/20201027.113341accepted/tizen/5.5/unified/mobile/hotfix/20201027.090719accepted/tizen/5.5/unified/20191031.023103tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unified
Change-Id: Ib467abdfa3b6b09a78e689438240945bc31e7ab6
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
-rw-r--r-- | src/heart/heart-abnormal.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/heart/heart-abnormal.c b/src/heart/heart-abnormal.c index 7096a82f..7ff900e3 100644 --- a/src/heart/heart-abnormal.c +++ b/src/heart/heart-abnormal.c @@ -177,15 +177,20 @@ static int heart_abnormal_report_malfunction(char *name) struct timeval time_of_day; int milli; time_t unix_time = time(NULL); + struct tm loc_tm; if (gettimeofday(&time_of_day, NULL)) { _E("gettimeofday failed"); return ret; } + if (!localtime_r(&time_of_day.tv_sec, &loc_tm)) { + _E("localtime_r failed"); + return ret; + } snprintf(timestr, sizeof(timestr), "%.10ld", unix_time); milli = time_of_day.tv_usec / MILLISEC; - strftime(ts, TIME_MAX_LEN, "%Y.%m.%d-%H:%M:%S", localtime(&time_of_day.tv_sec)); + strftime(ts, TIME_MAX_LEN, "%Y.%m.%d-%H:%M:%S", &loc_tm); snprintf(msgid, sizeof(msgid), "%s+%d", ts, milli); snprintf(pa1, TIMESTAMP_LEN, SLUG_TYPE_MALFUN); snprintf(pa2, TIMESTAMP_LEN, NOPID); |