summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanghyeok.oh <sanghyeok.oh@samsung.com>2019-10-18 09:46:12 +0900
committersanghyeok.oh <sanghyeok.oh@samsung.com>2019-10-18 09:47:59 +0900
commit8e88f4f5668504d9c42c651b15bbba285cfee1a1 (patch)
tree5ac640671bbecd86bf29189edffc3bfdd6d94c20
parentbf7fd13b2191ffd0d5a2b17afcd750d8cc648754 (diff)
downloadresourced-accepted/tizen_5.5_unified.tar.gz
resourced-accepted/tizen_5.5_unified.tar.bz2
resourced-accepted/tizen_5.5_unified.zip
Change-Id: Ib467abdfa3b6b09a78e689438240945bc31e7ab6 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
-rw-r--r--src/heart/heart-abnormal.c7
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);