aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-07-07 19:17:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-07-07 19:17:55 +0000
commit8d948cd1ec9917186c8356f87969bf8afc768717 (patch)
tree8449c41e367ecdde698b3e7eaa870b1a82ae1b8f /sys/compat/linux/linux_misc.c
parenta146c8c620aa165e3f65c43070e9335f2bf0729c (diff)
Notes
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index e72c528a33b7..eb9115d7f00d 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -131,22 +131,10 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
int i, j;
struct timespec ts;
- /* Uptime is copied out of print_uptime() in kern_shutdown.c */
getnanouptime(&ts);
- i = 0;
- if (ts.tv_sec >= 86400) {
- ts.tv_sec %= 86400;
- i = 1;
- }
- if (i || ts.tv_sec >= 3600) {
- ts.tv_sec %= 3600;
- i = 1;
- }
- if (i || ts.tv_sec >= 60) {
- ts.tv_sec %= 60;
- i = 1;
- }
- sysinfo.uptime=ts.tv_sec;
+ if (ts.tv_nsec != 0)
+ ts.tv_sec++;
+ sysinfo.uptime = ts.tv_sec;
/* Use the information from the mib to get our load averages */
for (i = 0; i < 3; i++)