Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2018 16:02:24 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340451 - head/sys/kern
Message-ID:  <201811151602.wAFG2O4Z040916@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Nov 15 16:02:24 2018
New Revision: 340451
URL: https://svnweb.freebsd.org/changeset/base/340451

Log:
  Do proper conversion to/from sbt.
  
  Doh! sbttoX and Xtosbt were backwards. While they ran, they produced
  bogus results.
  
  Pointy hat to: imp@

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Thu Nov 15 16:02:13 2018	(r340450)
+++ head/sys/kern/kern_sysctl.c	Thu Nov 15 16:02:24 2018	(r340451)
@@ -1702,13 +1702,13 @@ sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS)
 	sbintime_t sb;
 
 	tt = *(int64_t *)arg1;
-	sb = ustosbt(tt);
+	sb = sbttous(tt);
 
 	error = sysctl_handle_64(oidp, &sb, 0, req);
 	if (error || !req->newptr)
 		return (error);
 
-	tt = sbttous(sb);
+	tt = ustosbt(sb);
 	*(int64_t *)arg1 = tt;
 
 	return (0);
@@ -1725,13 +1725,13 @@ sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS)
 	sbintime_t sb;
 
 	tt = *(int64_t *)arg1;
-	sb = mstosbt(tt);
+	sb = sbttoms(tt);
 
 	error = sysctl_handle_64(oidp, &sb, 0, req);
 	if (error || !req->newptr)
 		return (error);
 
-	tt = sbttoms(sb);
+	tt = mstosbt(sb);
 	*(int64_t *)arg1 = tt;
 
 	return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811151602.wAFG2O4Z040916>