Fix cpu graph on single core.
(pushed upstream) from Tobias Ulmer <tobiasu at tmux dot org>, thanks! Use the new APM_ARCHS.
This commit is contained in:
parent
12bea17ac0
commit
5480e81690
@ -1,8 +1,11 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2010/01/09 13:55:15 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.2 2010/03/21 11:37:17 ajacoutot Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= ${APM_ARCHS}
|
||||
|
||||
COMMENT= simple system monitor bar
|
||||
|
||||
DISTNAME= xstatbar-0.3
|
||||
PKGNAME= ${DISTNAME}p0
|
||||
|
||||
CATEGORIES= sysutils x11
|
||||
|
||||
|
26
sysutils/xstatbar/patches/patch-stats_c
Normal file
26
sysutils/xstatbar/patches/patch-stats_c
Normal file
@ -0,0 +1,26 @@
|
||||
$OpenBSD: patch-stats_c,v 1.1 2010/03/21 11:37:17 ajacoutot Exp $
|
||||
|
||||
Fix cpu graph on single cores:
|
||||
sizeof(long) != sizeof(int64_t) on i386
|
||||
|
||||
--- stats.c.orig Thu Jan 7 18:08:14 2010
|
||||
+++ stats.c Mon Feb 1 08:29:25 2010
|
||||
@@ -456,9 +456,16 @@ sysinfo_update()
|
||||
err(1, "sysinfo update: KERN.CPTIME2.%d failed", cpu);
|
||||
}
|
||||
} else {
|
||||
+ int i;
|
||||
+ long cpu_raw_tmp[CPUSTATES];
|
||||
+ size = sizeof(cpu_raw_tmp);
|
||||
mib_cpus[1] = KERN_CPTIME;
|
||||
- if (sysctl(mib_cpus, 2, sysinfo.cpu_raw[0][cur], &size, NULL, 0) < 0)
|
||||
- err(1, "sysinfo update: KERN.CPTIME2 failed");
|
||||
+
|
||||
+ if (sysctl(mib_cpus, 2, cpu_raw_tmp, &size, NULL, 0) < 0)
|
||||
+ err(1, "sysinfo update: KERN.CPTIME failed");
|
||||
+
|
||||
+ for (i = 0; i < CPUSTATES; i++)
|
||||
+ sysinfo.cpu_raw[0][cur][i] = cpu_raw_tmp[i];
|
||||
}
|
||||
|
||||
/* convert ticks to percentages */
|
Loading…
x
Reference in New Issue
Block a user