From ae8d5821e03c0408aea43aaa0cd9df66e189fda8 Mon Sep 17 00:00:00 2001 From: Masatoshi Tateishi Date: Fri, 5 Jun 2015 12:51:07 +0900 Subject: [PATCH] procfs: Fix incorrect uptime with CONFIG_SYSTEM_TIME64 Jira: PDFW15IS-45 Signed-off-by: Masayuki Ishikawa --- fs/procfs/fs_procfsuptime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/procfs/fs_procfsuptime.c b/fs/procfs/fs_procfsuptime.c index f9e76cb897..c39ade3407 100644 --- a/fs/procfs/fs_procfsuptime.c +++ b/fs/procfs/fs_procfsuptime.c @@ -265,7 +265,11 @@ static ssize_t uptime_read(FAR struct file *filep, FAR char *buffer, /* Convert the seconds + hundredths of seconds to a string */ +#ifdef CONFIG_SYSTEM_TIME64 + linesize = snprintf(attr->line, UPTIME_LINELEN, "%7llu.%02u\n", sec, csec); +#else linesize = snprintf(attr->line, UPTIME_LINELEN, "%7lu.%02u\n", sec, csec); +#endif #endif /* Save the linesize in case we are re-entered with f_pos > 0 */