View | Details | Raw Unified | Return to bug 254397 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/wmcpuload/Makefile (-12 / +7 lines)
Lines 2-32 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	wmcpuload
4
PORTNAME=	wmcpuload
5
PORTVERSION=	1.0.1
5
PORTVERSION=	1.1.1
6
PORTREVISION=	4
6
7
CATEGORIES=	sysutils windowmaker
7
CATEGORIES=	sysutils windowmaker
8
MASTER_SITES=	http://seiichisato.jp/dockapps/src/
8
MASTER_SITES=	https://www.dockapps.net/download/
9
9
10
MAINTAINER=	xride@FreeBSD.org
10
MAINTAINER=	xride@FreeBSD.org
11
COMMENT=	"lcd" dockapp for windowmaker, which displays the current cpuload
11
COMMENT=	"lcd" dockapp for windowmaker, which displays the current cpuload
12
LICENSE=	GPLv2
12
13
13
BROKEN=		unfetchable
14
USES=		xorg
14
DEPRECATED=	Broken for more than 6 months
15
USE_XORG+=	x11 xext xpm
15
EXPIRATION_DATE=	2020-05-05
16
17
USES=		tar:bzip2 xorg
18
USE_XORG=	xpm
19
GNU_CONFIGURE=	yes
16
GNU_CONFIGURE=	yes
20
17
21
PORTDOCS=	ChangeLog README
22
PLIST_FILES=	"@(,kmem,2555) bin/wmcpuload" \
18
PLIST_FILES=	"@(,kmem,2555) bin/wmcpuload" \
23
		man/man1/wmcpuload.1.gz
19
		man/man1/wmcpuload.1.gz
20
PORTDOCS=	ChangeLog README
24
21
25
OPTIONS_DEFINE=	DOCS
22
OPTIONS_DEFINE=	DOCS
26
23
27
post-patch:
24
post-patch:
28
	@${REINPLACE_CMD} -e '/^DEFS/s|-I\.\.$$|-I.. -I../libdockapp/|g ; \
29
		 /^CFLAGS/s|-I../libdockapp/||g' ${WRKSRC}/src/Makefile.in
30
	@${REINPLACE_CMD} '/SETGID_FLAGS=/d' ${WRKSRC}/configure
25
	@${REINPLACE_CMD} '/SETGID_FLAGS=/d' ${WRKSRC}/configure
31
26
32
post-install:
27
post-install:
(-)sysutils/wmcpuload/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (wmcpuload-1.0.1.tar.bz2) = c05fffcf5b4aeb29280ac7e7762b937bddb9ac14283cf8e6110135009c6dd6f0
1
SHA256 (wmcpuload-1.1.1.tar.gz) = 8f08b2b937db105b677a9e4df2a67259d2580071e28456c0e6cd77db15f0648c
2
SIZE (wmcpuload-1.0.1.tar.bz2) = 92457
2
SIZE (wmcpuload-1.1.1.tar.gz) = 167751
(-)sysutils/wmcpuload/files/patch-src_cpu__freebsd.c (-22 / +17 lines)
Lines 1-6 Link Here
1
--- src/cpu_freebsd.c.orig	2008-05-03 07:05:31.000000000 +0200
1
--- src/cpu_freebsd.c.orig	2016-10-20 13:55:48 UTC
2
+++ src/cpu_freebsd.c	2008-05-03 07:12:09.000000000 +0200
2
+++ src/cpu_freebsd.c
3
@@ -18,7 +18,8 @@
3
@@ -16,7 +16,8 @@
4
 #include <string.h>
4
 #include <string.h>
5
 #include "cpu.h"
5
 #include "cpu.h"
6
 
6
 
Lines 10-16 Link Here
10
 #include <fcntl.h>
10
 #include <fcntl.h>
11
 
11
 
12
 #include <sys/param.h>
12
 #include <sys/param.h>
13
@@ -29,24 +30,18 @@
13
@@ -27,27 +28,21 @@
14
 #   include <sys/resource.h>
14
 #   include <sys/resource.h>
15
 #endif /* __FreeBSD_version < 500101 */
15
 #endif /* __FreeBSD_version < 500101 */
16
 
16
 
Lines 29-62 Link Here
29
 
29
 
30
-    if (kd == NULL) {
30
-    if (kd == NULL) {
31
-	fprintf(stderr, "can't open kernel virtual memory");
31
-	fprintf(stderr, "can't open kernel virtual memory");
32
-	exit(1);
33
-    }
34
-
35
-    kvm_nlist(kd, nlst);
36
-
37
-    if (nlst[0].n_type == 0) {
38
-	fprintf(stderr, "error extracting symbols");
39
+    if (sysctl_mib[0] == -1) {
32
+    if (sysctl_mib[0] == -1) {
40
+	fprintf(stderr, "unknown sysctl kern.cp_time");
33
+	fprintf(stderr, "unknown sysctl kern.cp_time");
41
 	exit(1);
34
 	exit(1);
42
     }
35
     }
43
 
36
 
44
@@ -68,14 +63,14 @@
37
-    kvm_nlist(kd, nlst);
38
-
39
-    if (nlst[0].n_type == 0) {
40
-	fprintf(stderr, "error extracting symbols");
41
-	exit(1);
42
-    }
43
-
44
     /* drop setgid & setuid (the latter should not be there really) */
45
     seteuid(getuid());
46
     setegid(getgid());
47
@@ -66,8 +61,8 @@ cpu_get_usage(cpu_options *opts)
45
     int used, total, result;
48
     int used, total, result;
46
     unsigned long int cpu_time[CPUSTATES];
49
     unsigned long int cpu_time[CPUSTATES];
47
 
50
 
48
-    if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) !=
51
-    if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) !=
49
-	sizeof(cpu_time))
52
-	sizeof(cpu_time))
50
-	return 0;
51
+    sysctl_len = sizeof(cpu_time);
53
+    sysctl_len = sizeof(cpu_time);
52
+    if (sysctl(sysctl_mib, 2, &cpu_time, &sysctl_len, NULL, 0) == -1)
54
+    if (sysctl(sysctl_mib, 2, &cpu_time, &sysctl_len, NULL, 0) == -1)
53
+	 return 0;
55
 	return 0;
54
 
56
 
55
     used = cpu_time[CP_USER] + cpu_time[CP_SYS];
57
     /* calculate usage */
56
     if (!opts->ignore_nice)
57
 	used += cpu_time[CP_NICE];
58
-    total = used + cpu_time[CP_IDLE];
59
+    total = used + cpu_time[CP_IDLE] + cpu_time[CP_NICE];
60
 
61
     if (pre_total == 0) {
62
 	result = 0;

Return to bug 254397