From 556fe1a6598bbd1bee4a98587b4a2329697963d0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 8 Oct 2013 23:16:01 +0200 Subject: [PATCH] linux: ignore fractional time in uv_uptime() Before this commit, uv_uptime() returned the nanoseconds as the fractional part of the uptime. It's a bit inconsistent with the output on other platforms because those only return whole seconds (with the possible exception of Windows.) This commit changes linux-core.c to only return whole seconds. --- src/unix/linux-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/unix/linux-core.c b/src/unix/linux-core.c index 29a80d87..8bdd53d2 100644 --- a/src/unix/linux-core.c +++ b/src/unix/linux-core.c @@ -368,7 +368,6 @@ int uv_uptime(double* uptime) { return -errno; *uptime = now.tv_sec; - *uptime += (double)now.tv_nsec / 1000000000.0; return 0; }