From: Nikita Kalyazin Date: Sat, 5 Oct 2013 16:08:52 +0000 (+0400) Subject: [FIX] time parsing (fix sec/nsec order) X-Git-Tag: Tizen_SDK_2.3~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=483d8a28c46d44a7b4426ac746283059b4baba77;p=platform%2Fcore%2Fsystem%2Fswap-manager.git [FIX] time parsing (fix sec/nsec order) Change-Id: I6e24c39ce9ad53aa7eef6a3bdc2261d30944df23 Signed-off-by: Nikita Kalyazin --- diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index 2b7783f..d2f31b2 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -525,17 +525,16 @@ static int parse_timeval(struct msg_buf_t *msg, struct timeval *tv) parse_deb("time\n"); - // FIXME: is sec/usec order correct? - if (!parse_int32(msg, &nsec)) { - LOGE("usec parsing error\n"); + if (!parse_int32(msg, (uint32_t *)&tv->tv_sec)) { + LOGE("sec parsing error\n"); return 0; } - tv->tv_usec = nsec / 1000; - if (!parse_int32(msg, (uint32_t *)&tv->tv_sec)) { - LOGE("sec parsing error\n"); + if (!parse_int32(msg, &nsec)) { + LOGE("usec parsing error\n"); return 0; } + tv->tv_usec = nsec / 1000; return 1; }