summaryrefslogtreecommitdiffstats
path: root/devel/libgtop
diff options
context:
space:
mode:
Diffstat (limited to 'devel/libgtop')
-rw-r--r--devel/libgtop/Makefile3
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_open.c36
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c13
3 files changed, 51 insertions, 1 deletions
diff --git a/devel/libgtop/Makefile b/devel/libgtop/Makefile
index f95805ab0..bcdb401dc 100644
--- a/devel/libgtop/Makefile
+++ b/devel/libgtop/Makefile
@@ -3,11 +3,12 @@
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/devel/libgtop/Makefile,v 1.39 2008/08/19 01:57:58 kwm Exp $
+# $MCom: ports/devel/libgtop/Makefile,v 1.40 2008/09/23 14:50:47 kwm Exp $
#
PORTNAME= libgtop
PORTVERSION= 2.24.0
+PORTREVISION= 1
CATEGORIES= devel gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_open.c b/devel/libgtop/files/patch-sysdeps_freebsd_open.c
new file mode 100644
index 000000000..eee11421d
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_open.c
@@ -0,0 +1,36 @@
+--- sysdeps/freebsd/open.c.orig 2008-09-29 13:44:47.000000000 -0400
++++ sysdeps/freebsd/open.c 2008-09-29 13:49:37.000000000 -0400
+@@ -20,11 +20,14 @@
+ */
+
+ #include <config.h>
++#include <sys/types.h>
++#include <sys/sysctl.h>
+ #include <glibtop.h>
+ #include <glibtop/error.h>
+ #include <glibtop/open.h>
+ #include <glibtop/init_hooks.h>
+
++
+ /* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
+
+ void
+@@ -53,11 +56,18 @@ glibtop_open_p (glibtop *server, const c
+ const unsigned long features,
+ const unsigned flags)
+ {
++ guint64 ncpus;
++ size_t len;
+ #ifdef DEBUG
+ fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
+ #endif
+
+ /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
++ len = sizeof (ncpus);
++ sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0);
++ server->ncpu = ncpus;
++ /* XXX We should detect HTT CPUs here. */
++ server->real_ncpu = ncpus;
+
+ server->machine.uid = getuid ();
+ server->machine.euid = geteuid ();
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c b/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c
new file mode 100644
index 000000000..3d6026e4c
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c
@@ -0,0 +1,13 @@
+--- sysdeps/freebsd/sysinfo.c.orig 2008-09-29 13:44:45.000000000 -0400
++++ sysdeps/freebsd/sysinfo.c 2008-09-29 13:50:06.000000000 -0400
+@@ -45,8 +45,8 @@ init_sysinfo (glibtop *server)
+
+ glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
+
+- len = sizeof (ncpus);
+- sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0);
++ ncpus = server->ncpu;
++
+ len = 0;
+ sysctlbyname ("hw.model", NULL, &len, NULL, 0);
+ model = g_malloc (len);