Module Name:    src
Committed By:   kre
Date:           Tue Oct 30 21:15:09 UTC 2018

Modified Files:
        src/external/bsd/top/dist/machine: m_netbsd.c
        src/usr.bin/w: w.c
        src/usr.sbin/rwhod: rwhod.c

Log Message:
sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/top/dist/machine/m_netbsd.c
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/w/w.c
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/rwhod/rwhod.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.20 src/external/bsd/top/dist/machine/m_netbsd.c:1.21
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.20	Thu May 31 10:14:21 2018
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Tue Oct 30 21:15:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.20 2018/05/31 10:14:21 kamil Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran <[email protected]>
  *
  *
- * $Id: m_netbsd.c,v 1.20 2018/05/31 10:14:21 kamil Exp $
+ * $Id: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $
  */
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.20 2018/05/31 10:14:21 kamil Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $");
 #endif
 
 #include <sys/param.h>
@@ -306,7 +306,7 @@ machine_init(statics)
 	int mib[2];
 	size_t size;
 	struct clockinfo clockinfo;
-	struct timeval boottime;
+	struct timespec boottime;
 
 	if ((kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open")) == NULL)
 		return -1;

Index: src/usr.bin/w/w.c
diff -u src/usr.bin/w/w.c:1.83 src/usr.bin/w/w.c:1.84
--- src/usr.bin/w/w.c:1.83	Wed Nov 16 02:03:30 2016
+++ src/usr.bin/w/w.c	Tue Oct 30 21:15:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: w.c,v 1.83 2016/11/16 02:03:30 christos Exp $	*/
+/*	$NetBSD: w.c,v 1.84 2018/10/30 21:15:09 kre Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)w.c	8.6 (Berkeley) 6/30/94";
 #else
-__RCSID("$NetBSD: w.c,v 1.83 2016/11/16 02:03:30 christos Exp $");
+__RCSID("$NetBSD: w.c,v 1.84 2018/10/30 21:15:09 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -86,7 +86,7 @@ __RCSID("$NetBSD: w.c,v 1.83 2016/11/16 
 
 #include "extern.h"
 
-struct timeval	boottime;
+struct timespec	boottime;
 struct winsize	ws;
 kvm_t	       *kd;
 time_t		now;		/* the current time of day */

Index: src/usr.sbin/rwhod/rwhod.c
diff -u src/usr.sbin/rwhod/rwhod.c:1.40 src/usr.sbin/rwhod/rwhod.c:1.41
--- src/usr.sbin/rwhod/rwhod.c:1.40	Sun Nov  4 22:32:01 2012
+++ src/usr.sbin/rwhod/rwhod.c	Tue Oct 30 21:15:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rwhod.c,v 1.40 2012/11/04 22:32:01 christos Exp $	*/
+/*	$NetBSD: rwhod.c,v 1.41 2018/10/30 21:15:09 kre Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)rwhod.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: rwhod.c,v 1.40 2012/11/04 22:32:01 christos Exp $");
+__RCSID("$NetBSD: rwhod.c,v 1.41 2018/10/30 21:15:09 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -426,7 +426,7 @@ getboottime(void)
 {
 	int mib[2];
 	size_t size;
-	struct timeval tm;
+	struct timespec tm;
 
 	mib[0] = CTL_KERN;
 	mib[1] = KERN_BOOTTIME;

Reply via email to