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 corediff -r1.76 -r1.77 pkgsrc/sysutils/xosview/Makefile
(bsiegert)
@@ -1,16 +1,17 @@ | @@ -1,16 +1,17 @@ | |||
1 | # $NetBSD: Makefile,v 1.76 2020/05/24 11:24:19 rillig Exp $ | 1 | # $NetBSD: Makefile,v 1.77 2020/07/07 19:13:18 bsiegert Exp $ | |
2 | 2 | |||
3 | DISTNAME= xosview-1.22 | 3 | DISTNAME= xosview-1.22 | |
4 | PKGREVISION= 1 | |||
4 | CATEGORIES= sysutils x11 | 5 | CATEGORIES= sysutils x11 | |
5 | MASTER_SITES= ${MASTER_SITE_GITHUB:=hills/} | 6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=hills/} | |
6 | 7 | |||
7 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
8 | HOMEPAGE= https://www.pogo.org.uk/~mark/xosview/ | 9 | HOMEPAGE= https://www.pogo.org.uk/~mark/xosview/ | |
9 | COMMENT= X11 graphical display of OS statistics | 10 | COMMENT= X11 graphical display of OS statistics | |
10 | 11 | |||
11 | USE_TOOLS+= gmake | 12 | USE_TOOLS+= gmake | |
12 | USE_LANGUAGES= c gnu++03 | 13 | USE_LANGUAGES= c gnu++03 | |
13 | 14 | |||
14 | AUTO_MKDIRS= yes | 15 | AUTO_MKDIRS= yes | |
15 | 16 | |||
16 | .include "../../mk/bsd.prefs.mk" | 17 | .include "../../mk/bsd.prefs.mk" |
@@ -1,7 +1,7 @@ | @@ -1,7 +1,7 @@ | |||
1 | $NetBSD: distinfo,v 1.31 2020/05/24 11:29:13 rillig Exp $ | 1 | $NetBSD: distinfo,v 1.32 2020/07/07 19:13:18 bsiegert Exp $ | |
2 | 2 | |||
3 | SHA1 (xosview-1.22.tar.gz) = 47bf5fe6f61ac828bc7707abec0c1e4bb8da9e13 | 3 | SHA1 (xosview-1.22.tar.gz) = 47bf5fe6f61ac828bc7707abec0c1e4bb8da9e13 | |
4 | RMD160 (xosview-1.22.tar.gz) = 217ec543afee8b77bb36ad639c872a5af3b660a6 | 4 | RMD160 (xosview-1.22.tar.gz) = 217ec543afee8b77bb36ad639c872a5af3b660a6 | |
5 | SHA512 (xosview-1.22.tar.gz) = 40e668ff1d142b6986ea5d50475d4c82523c62269d328d2f6001c651808d9b5194ccd6f144fd0ff791110302c91688126aca5762d6645d9dbc3819cd15df343b | 5 | SHA512 (xosview-1.22.tar.gz) = 40e668ff1d142b6986ea5d50475d4c82523c62269d328d2f6001c651808d9b5194ccd6f144fd0ff791110302c91688126aca5762d6645d9dbc3819cd15df343b | |
6 | Size (xosview-1.22.tar.gz) = 147492 bytes | 6 | Size (xosview-1.22.tar.gz) = 147492 bytes | |
7 | SHA1 (patch-bsd_kernel.cc) = 7406cd7747b67c5bdadc1b779280d458813457e2 | 7 | SHA1 (patch-bsd_kernel.cc) = 7a86aab574c2d7cf88fdb03b95a8ab46933d5e48 |
@@ -1,21 +1,30 @@ | @@ -1,21 +1,30 @@ | |||
1 | $NetBSD: patch-bsd_kernel.cc,v 1.2 2020/05/24 11:29:13 rillig Exp $ | 1 | $NetBSD: patch-bsd_kernel.cc,v 1.3 2020/07/07 19:13:18 bsiegert Exp $ | |
2 | 2 | |||
3 | Don't fail for unprivileged users. | 3 | Don't fail for unprivileged users. | |
4 | 4 | |||
5 | https://github.com/hills/xosview/pull/15 | 5 | https://github.com/hills/xosview/pull/15 | |
6 | 6 | |||
7 | --- bsd/kernel.cc.orig 2020-02-22 19:33:08.000000000 +0000 | 7 | --- bsd/kernel.cc.orig 2020-02-22 19:33:08.000000000 +0000 | |
8 | +++ bsd/kernel.cc | 8 | +++ bsd/kernel.cc | |
9 | @@ -219,8 +219,10 @@ OpenKDIfNeeded() { | 9 | @@ -219,8 +219,10 @@ OpenKDIfNeeded() { | |
10 | * that kernel file. Otherwise, use the default kernel, by | 10 | * that kernel file. Otherwise, use the default kernel, by | |
11 | * specifying NULL. */ | 11 | * specifying NULL. */ | |
12 | if ((kd = kvm_openfiles((kernelFileName[0] ? kernelFileName : NULL), | 12 | if ((kd = kvm_openfiles((kernelFileName[0] ? kernelFileName : NULL), | |
13 | - NULL, NULL, O_RDONLY, errstring)) == NULL) | 13 | - NULL, NULL, O_RDONLY, errstring)) == NULL) | |
14 | - err(EX_OSFILE, "OpenKDIfNeeded(): %s", errstring); | 14 | - err(EX_OSFILE, "OpenKDIfNeeded(): %s", errstring); | |
15 | + NULL, NULL, O_RDONLY, errstring)) == NULL) { | 15 | + NULL, NULL, O_RDONLY, errstring)) == NULL) { | |
16 | + warn("OpenKDIfNeeded(): %s", errstring); | 16 | + warn("OpenKDIfNeeded(): %s", errstring); | |
17 | + return; | 17 | + return; | |
18 | + } | 18 | + } | |
19 | 19 | |||
20 | // Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get | 20 | // Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get | |
21 | // the correct kernel file if the 1st arg is NULL. As far as I can see, | 21 | // the correct kernel file if the 1st arg is NULL. As far as I can see, | |
22 | @@ -276,7 +278,7 @@ BSDGetCPUSpeed() { | |||
23 | size = sizeof(speed); | |||
24 | #if defined(XOSVIEW_NETBSD) | |||
25 | if ( sysctlbyname("machdep.tsc_freq", &speed, &size, NULL, 0) < 0 ) | |||
26 | - err(EX_OSERR, "sysctl machdep.tsc_freq failed"); | |||
27 | + return 0; | |||
28 | #else /* XOSVIEW_DFBSD */ | |||
29 | if ( sysctlbyname("hw.tsc_frequency", &speed, &size, NULL, 0) < 0 ) | |||
30 | err(EX_OSERR, "sysctl hw.tsc_frequency failed"); |