pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils sysctl() uses size_t arguments for lengths, s...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/99bf3a19066b
branches:  trunk
changeset: 477565:99bf3a19066b
user:      cube <cube%pkgsrc.org@localhost>
date:      Mon Jul 05 08:42:27 2004 +0000

description:
sysctl() uses size_t arguments for lengths, so don't pass a pointer to an
int, it breaks on 64-bits platforms.

While there, prevent sa_family_t from being redefined by making sure
__NetBSD_Version__ is defined.

Bump revision of both gkrellm and gkrellm-server.

Should fix PR 26144.

diffstat:

 sysutils/gkrellm-server/Makefile  |   4 +-
 sysutils/gkrellm/Makefile         |   4 +-
 sysutils/gkrellm/distinfo         |   5 ++-
 sysutils/gkrellm/patches/patch-ab |  50 ++++++++++++++++++++++++++------------
 sysutils/gkrellm/patches/patch-ae |  12 +++++++++
 5 files changed, 53 insertions(+), 22 deletions(-)

diffs (154 lines):

diff -r 954211f482c2 -r 99bf3a19066b sysutils/gkrellm-server/Makefile
--- a/sysutils/gkrellm-server/Makefile  Mon Jul 05 08:05:45 2004 +0000
+++ b/sysutils/gkrellm-server/Makefile  Mon Jul 05 08:42:27 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2004/06/07 17:01:50 cube Exp $
+# $NetBSD: Makefile,v 1.7 2004/07/05 08:42:27 cube Exp $
 .include "../../sysutils/gkrellm/Makefile.common"
 
-PKGREVISION=           1
+PKGREVISION=           2
 
 GKRELLM_PKGBASE=       gkrellm-server
 COMMENT=               Monitoring daemon remotely accessible by a GKrellM client
diff -r 954211f482c2 -r 99bf3a19066b sysutils/gkrellm/Makefile
--- a/sysutils/gkrellm/Makefile Mon Jul 05 08:05:45 2004 +0000
+++ b/sysutils/gkrellm/Makefile Mon Jul 05 08:42:27 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.36 2004/06/07 17:01:50 cube Exp $
+# $NetBSD: Makefile,v 1.37 2004/07/05 08:42:27 cube Exp $
 .include "Makefile.common"
 
-PKGREVISION=           1
+PKGREVISION=           2
 
 GKRELLM_PKGBASE=       gkrellm
 WRKSRC=                        ${GKRELLM_SRCDIR}
diff -r 954211f482c2 -r 99bf3a19066b sysutils/gkrellm/distinfo
--- a/sysutils/gkrellm/distinfo Mon Jul 05 08:05:45 2004 +0000
+++ b/sysutils/gkrellm/distinfo Mon Jul 05 08:42:27 2004 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.26 2004/06/07 17:28:44 cube Exp $
+$NetBSD: distinfo,v 1.27 2004/07/05 08:42:27 cube Exp $
 
 SHA1 (gkrellm-2.2.1.tar.bz2) = 4a4d296a61307b3a0b93da035c07e301ed474dbc
 Size (gkrellm-2.2.1.tar.bz2) = 663952 bytes
 SHA1 (patch-aa) = e7d7dc8f3189632a8a0855c3fc39479482407cc4
-SHA1 (patch-ab) = 9688dc53a784d808e79d04bbccd382305e6e2276
+SHA1 (patch-ab) = de2ef6e1d083a32c274d2ec42fa1b9e9d3d65663
 SHA1 (patch-ac) = 8890d5a5e8eaf21508a1bf91de788183fd6f7a75
 SHA1 (patch-ad) = c33319783a40ad64f43015200047656efc1bcdb3
+SHA1 (patch-ae) = 5f7b1bdfa99bcec9cfdaee3a97b38b27581dd954
diff -r 954211f482c2 -r 99bf3a19066b sysutils/gkrellm/patches/patch-ab
--- a/sysutils/gkrellm/patches/patch-ab Mon Jul 05 08:05:45 2004 +0000
+++ b/sysutils/gkrellm/patches/patch-ab Mon Jul 05 08:42:27 2004 +0000
@@ -1,8 +1,27 @@
-$NetBSD: patch-ab,v 1.12 2004/06/07 17:28:44 cube Exp $
+$NetBSD: patch-ab,v 1.13 2004/07/05 08:42:27 cube Exp $
 
 --- src/sysdeps/netbsd.c.orig  2004-05-01 19:46:38.000000000 +0200
 +++ src/sysdeps/netbsd.c
-@@ -109,41 +109,35 @@ get_ncpus(void)
+@@ -63,7 +63,8 @@ gkrellm_sys_cpu_read_data(void)
+ {
+    static int mib[] = { CTL_KERN, KERN_CP_TIME };
+    u_int64_t cp_time[ncpus][CPUSTATES];
+-   int len, n;
++   int n;
++   size_t len;
+ 
+    if (ncpus > 1) {
+        len = sizeof(cp_time[0]);
+@@ -94,7 +95,7 @@ get_ncpus(void)
+ {
+       static int mib[] = { CTL_HW, HW_NCPU };
+       int ncpus;
+-      int len = sizeof(int);
++      size_t len = sizeof(int);
+ 
+       if (sysctl(mib, 2, &ncpus, &len, NULL, 0) < 0)
+               return 1;
+@@ -109,41 +110,35 @@ get_ncpus(void)
  #include <sys/proc.h>
  #include <sys/sysctl.h>
  #include <uvm/uvm_extern.h>
@@ -30,16 +49,6 @@
 -
 -   if (sysctl(mib, 3, NULL, &len, NULL, 0) >= 0) {
 -      n_processes = len / sizeof(struct kinfo_proc);
--   }
--
--   /* get name list if it is not done yet */
--   if (kvmd == NULL) return;
--   if (nl[0].n_type == 0) kvm_nlist(kvmd, nl);
--
--   if (nl[0].n_type != 0) {
--      uvmexp = (struct uvmexp *)nl[X_UVM_EXP].n_value;
--      if (kvm_read(kvmd, (u_long)&uvmexp->forks, &i, sizeof(i)) == sizeof(i))
--       n_forks = i;
 +   guint n_forks = 0, n_processes = 0;
 +   struct uvmexp_sysctl uvmexp;
 +   size_t size;
@@ -54,17 +63,26 @@
 +      n_processes = size / sizeof(struct kinfo_proc2);
     }
  
+-   /* get name list if it is not done yet */
+-   if (kvmd == NULL) return;
+-   if (nl[0].n_type == 0) kvm_nlist(kvmd, nl);
+-
+-   if (nl[0].n_type != 0) {
+-      uvmexp = (struct uvmexp *)nl[X_UVM_EXP].n_value;
+-      if (kvm_read(kvmd, (u_long)&uvmexp->forks, &i, sizeof(i)) == sizeof(i))
+-       n_forks = i;
 +   mib[0] = CTL_VM;
 +   mib[1] = VM_UVMEXP2;
 +   size = sizeof(uvmexp);
 +   if (sysctl(mib, 2, &uvmexp, &size, NULL, 0) >= 0) {
 +      n_forks = uvmexp.forks;
-+   }
+    }
+-
 + 
     if (getloadavg(&avenrun, 1) <= 0)
                avenrun = 0;
        gkrellm_proc_assign_data(n_processes, 0, n_forks, avenrun);
-@@ -183,6 +177,97 @@ gkrellm_sys_proc_init(void)
+@@ -183,6 +178,97 @@ gkrellm_sys_proc_init(void)
  
  
  /* ===================================================================== */
@@ -162,7 +180,7 @@
  /* Sensor monitor interface */
  
    /* Tables of voltage correction factors and offsets derived from the
-@@ -295,7 +380,7 @@ gkrellm_sys_sensors_init(void)
+@@ -295,7 +381,7 @@ gkrellm_sys_sensors_init(void)
     int fd;                    /* file desc. for /dev/sysmon */
     int id = 0;                        /* incremented for each sensor */
     int type;
@@ -171,7 +189,7 @@
     gboolean   found_sensors = FALSE;
  
     /* check if some sensor is configured */
-@@ -336,3 +421,68 @@ gkrellm_sys_sensors_init(void)
+@@ -336,3 +422,68 @@ gkrellm_sys_sensors_init(void)
     return found_sensors;
  }
  
diff -r 954211f482c2 -r 99bf3a19066b sysutils/gkrellm/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/gkrellm/patches/patch-ae Mon Jul 05 08:42:27 2004 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-ae,v 1.1 2004/07/05 08:42:27 cube Exp $
+
+--- server/gkrellmd-private.h.orig     2004-05-03 04:21:48.000000000 +0200
++++ server/gkrellmd-private.h
+@@ -41,6 +41,7 @@
+ 
+ #if defined(__NetBSD__)
+ #define HAVE_GETADDRINFO      1
++#include <sys/param.h>
+ #  if __NetBSD_Version__ <= 105010000
+ #    define sa_family_t unsigned char
+ #  endif



Home | Main Index | Thread Index | Old Index