xosview: do not exit when cpufreq sysctl fails.

I don't know why xosview needs cpu frequency at all when it doesn't display
it. But:

- different architectures use different sysctl names (that's why it's called
  machdep)
- what even is the meaning of the "cpu frequency" when you can set frequency
  per core
This commit is contained in:
bsiegert 2020-07-07 19:13:18 +00:00
parent 7b8ff0a630
commit 2c68e0dcad
3 changed files with 14 additions and 4 deletions

View file

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.76 2020/05/24 11:24:19 rillig Exp $
# $NetBSD: Makefile,v 1.77 2020/07/07 19:13:18 bsiegert Exp $
DISTNAME= xosview-1.22
PKGREVISION= 1
CATEGORIES= sysutils x11
MASTER_SITES= ${MASTER_SITE_GITHUB:=hills/}

View file

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.31 2020/05/24 11:29:13 rillig Exp $
$NetBSD: distinfo,v 1.32 2020/07/07 19:13:18 bsiegert Exp $
SHA1 (xosview-1.22.tar.gz) = 47bf5fe6f61ac828bc7707abec0c1e4bb8da9e13
RMD160 (xosview-1.22.tar.gz) = 217ec543afee8b77bb36ad639c872a5af3b660a6
SHA512 (xosview-1.22.tar.gz) = 40e668ff1d142b6986ea5d50475d4c82523c62269d328d2f6001c651808d9b5194ccd6f144fd0ff791110302c91688126aca5762d6645d9dbc3819cd15df343b
Size (xosview-1.22.tar.gz) = 147492 bytes
SHA1 (patch-bsd_kernel.cc) = 7406cd7747b67c5bdadc1b779280d458813457e2
SHA1 (patch-bsd_kernel.cc) = 7a86aab574c2d7cf88fdb03b95a8ab46933d5e48

View file

@ -1,4 +1,4 @@
$NetBSD: patch-bsd_kernel.cc,v 1.2 2020/05/24 11:29:13 rillig Exp $
$NetBSD: patch-bsd_kernel.cc,v 1.3 2020/07/07 19:13:18 bsiegert Exp $
Don't fail for unprivileged users.
@ -19,3 +19,12 @@ https://github.com/hills/xosview/pull/15
// Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get
// the correct kernel file if the 1st arg is NULL. As far as I can see,
@@ -276,7 +278,7 @@ BSDGetCPUSpeed() {
size = sizeof(speed);
#if defined(XOSVIEW_NETBSD)
if ( sysctlbyname("machdep.tsc_freq", &speed, &size, NULL, 0) < 0 )
- err(EX_OSERR, "sysctl machdep.tsc_freq failed");
+ return 0;
#else /* XOSVIEW_DFBSD */
if ( sysctlbyname("hw.tsc_frequency", &speed, &size, NULL, 0) < 0 )
err(EX_OSERR, "sysctl hw.tsc_frequency failed");