diff options
author | macallan <macallan@pkgsrc.org> | 2008-12-19 20:20:22 +0000 |
---|---|---|
committer | macallan <macallan@pkgsrc.org> | 2008-12-19 20:20:22 +0000 |
commit | 15e370a601746032bfb17a0181e4c5bccb796482 (patch) | |
tree | 0b18841779edff136219de3b9b6ddd1e23de2f12 /sysutils/gkrellm | |
parent | 372173827be87a46c118b5dd22da87d303445e92 (diff) | |
download | pkgsrc-15e370a601746032bfb17a0181e4c5bccb796482.tar.gz |
fix botched NetBSD version check so we can use the getifdata() method to
collect interface statistics. Also gracefully deal with NULL if_data.
Now this works again on sparc64.
OKed by cube
Diffstat (limited to 'sysutils/gkrellm')
-rw-r--r-- | sysutils/gkrellm/patches/patch-aa | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/sysutils/gkrellm/patches/patch-aa b/sysutils/gkrellm/patches/patch-aa index 1dc8ea26296..2263c8bb24b 100644 --- a/sysutils/gkrellm/patches/patch-aa +++ b/sysutils/gkrellm/patches/patch-aa @@ -1,8 +1,27 @@ -$NetBSD: patch-aa,v 1.16 2006/03/19 22:10:38 joerg Exp $ +$NetBSD: patch-aa,v 1.17 2008/12/19 20:20:22 macallan Exp $ ---- src/sysdeps/bsd-common.c.orig 2005-05-24 03:44:21.000000000 +0000 +--- src/sysdeps/bsd-common.c.orig 2006-03-29 17:23:37.000000000 -0500 +++ src/sysdeps/bsd-common.c -@@ -255,7 +255,11 @@ void +@@ -23,7 +23,7 @@ + */ + + #if !(defined(__FreeBSD__) && __FreeBSD_version < 410000) && \ +- !(defined(__NetBSD__) && __NetBSD_version < 105000000) && \ ++ !(defined(__NetBSD__) && __NetBSD_Version__ < 105000000) && \ + !(defined(__OpenBSD__) && OpenBSD < 200006) && \ + !defined(__APPLE__) + #define HAVE_GETIFADDRS 1 +@@ -52,8 +52,11 @@ gkrellm_sys_net_read_data(void) + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + ifd = (struct if_data *)ifa->ifa_data; ++ if (ifd == NULL) ++ continue; ++ + gkrellm_net_assign_data(ifa->ifa_name, + ifd->ifi_ibytes, ifd->ifi_obytes); + } +@@ -255,7 +258,11 @@ void gkrellm_sys_fs_get_mounts_list(void) { gchar *s, *dev, *dir, *type; @@ -14,7 +33,7 @@ $NetBSD: patch-aa,v 1.16 2006/03/19 22:10:38 joerg Exp $ gint mntsize, i; if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) -@@ -281,12 +285,24 @@ gkrellm_sys_fs_get_mounts_list(void) +@@ -281,12 +288,24 @@ gkrellm_sys_fs_get_mounts_list(void) void gkrellm_sys_fs_get_fsusage(gpointer fs, gchar *dir) { @@ -39,7 +58,7 @@ $NetBSD: patch-aa,v 1.16 2006/03/19 22:10:38 joerg Exp $ else gkrellm_fs_assign_fsusage_data(fs, 0, 0, 0, 0); } -@@ -345,7 +361,7 @@ gkrellm_sys_fs_init(void) +@@ -345,7 +364,7 @@ gkrellm_sys_fs_init(void) } #endif |