Index: head/sysutils/wmcpuload/Makefile =================================================================== --- head/sysutils/wmcpuload/Makefile (revision 214485) +++ head/sysutils/wmcpuload/Makefile (revision 214486) @@ -1,38 +1,38 @@ # New ports collection makefile for: wmcpuload # Date created: 18 Apr 2001 # Whom: Soeren Boll Overgaard # # $FreeBSD$ # PORTNAME= wmcpuload PORTVERSION= 1.0.1 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils windowmaker MASTER_SITES= http://seiichisato.jp/dockapps/src/ MAINTAINER= xride@FreeBSD.org COMMENT= An "lcd" dockapp for windowmaker, which displays the current cpuload USE_BZIP2= yes USE_XORG= xpm USE_GNOME= gnometarget GNU_CONFIGURE= yes MAN1= wmcpuload.1 PORTDOCS= ChangeLog README PLIST_FILES= bin/wmcpuload post-patch: @${REINPLACE_CMD} -e '/^DEFS/s|-I\.\.$$|-I.. -I../libdockapp/|g ; \ /^CFLAGS/s|-I../libdockapp/||g' ${WRKSRC}/src/Makefile.in post-install: .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif # !NOPORTDOCS .include Property changes on: head/sysutils/wmcpuload/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.23 \ No newline at end of property +1.24 \ No newline at end of property Index: head/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c =================================================================== --- head/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c (revision 214485) +++ head/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c (revision 214486) @@ -1,11 +1,62 @@ ---- src/cpu_freebsd.c.orig Sat Mar 8 03:40:25 2003 -+++ src/cpu_freebsd.c Wed Nov 30 13:42:56 2005 -@@ -75,7 +75,7 @@ +--- src/cpu_freebsd.c.orig 2008-05-03 07:05:31.000000000 +0200 ++++ src/cpu_freebsd.c 2008-05-03 07:12:09.000000000 +0200 +@@ -18,7 +18,8 @@ + #include + #include "cpu.h" + +-#include ++#include ++#include + #include + + #include +@@ -29,24 +30,18 @@ + # include + #endif /* __FreeBSD_version < 500101 */ + +-static kvm_t *kd = NULL; +-static struct nlist nlst[] = { {"_cp_time"}, {0} }; ++static int sysctl_mib[2] = { -1, -1 }; ++static size_t sysctl_len; + + void + cpu_init(void) + { + +- kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open"); ++ sysctl_len = 2; ++ sysctlnametomib("kern.cp_time", sysctl_mib, &sysctl_len); + +- if (kd == NULL) { +- fprintf(stderr, "can't open kernel virtual memory"); +- exit(1); +- } +- +- kvm_nlist(kd, nlst); +- +- if (nlst[0].n_type == 0) { +- fprintf(stderr, "error extracting symbols"); ++ if (sysctl_mib[0] == -1) { ++ fprintf(stderr, "unknown sysctl kern.cp_time"); + exit(1); + } + +@@ -68,14 +63,14 @@ + int used, total, result; + unsigned long int cpu_time[CPUSTATES]; + +- if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) != +- sizeof(cpu_time)) +- return 0; ++ sysctl_len = sizeof(cpu_time); ++ if (sysctl(sysctl_mib, 2, &cpu_time, &sysctl_len, NULL, 0) == -1) ++ return 0; + used = cpu_time[CP_USER] + cpu_time[CP_SYS]; if (!opts->ignore_nice) used += cpu_time[CP_NICE]; - total = used + cpu_time[CP_IDLE]; + total = used + cpu_time[CP_IDLE] + cpu_time[CP_NICE]; if (pre_total == 0) { result = 0; Property changes on: head/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1 \ No newline at end of property +1.2 \ No newline at end of property