diff options
author | marino <marino@pkgsrc.org> | 2012-03-23 17:29:51 +0000 |
---|---|---|
committer | marino <marino@pkgsrc.org> | 2012-03-23 17:29:51 +0000 |
commit | dd65525e1123c743da6d10b1d1c0d18140042911 (patch) | |
tree | 12c68673eb1f2060135fd16ff0f0657d737db6ec /sysutils/libgtop | |
parent | f0e61ac3f71913e4062e099d8737243f58df9642 (diff) | |
download | pkgsrc-dd65525e1123c743da6d10b1d1c0d18140042911.tar.gz |
sysutils/libgtop: Unbreak DragonFly again
Libgtop on DragonFly is built using FreeBSD-specific files. The systems
are diverging and it's getting harder to keep this package from breaking
everytime it's updated. This minor point upgrade broke it!
Diffstat (limited to 'sysutils/libgtop')
-rw-r--r-- | sysutils/libgtop/distinfo | 3 | ||||
-rw-r--r-- | sysutils/libgtop/patches/patch-sysdeps_freebsd_procwd.c | 38 |
2 files changed, 40 insertions, 1 deletions
diff --git a/sysutils/libgtop/distinfo b/sysutils/libgtop/distinfo index 694ec8b1b96..3fd15f13f03 100644 --- a/sysutils/libgtop/distinfo +++ b/sysutils/libgtop/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.26 2012/01/19 19:43:57 drochner Exp $ +$NetBSD: distinfo,v 1.27 2012/03/23 17:29:51 marino Exp $ SHA1 (libgtop-2.28.4.tar.bz2) = b6f002cc80a61dc0908dd96e0b543113a46bc4b7 RMD160 (libgtop-2.28.4.tar.bz2) = 96ac76aa409bbd202bedacd94df14cd549e10d6b @@ -36,3 +36,4 @@ SHA1 (patch-dk) = c95e5aa709dff7685af03f19e830d15fd17c0315 SHA1 (patch-dl) = 9d6a44be02ec21d195076125c0cdfe5b51a0ab0a SHA1 (patch-dm) = ef08973aecacb1fb69f258632dd36edfdafd8c50 SHA1 (patch-dn) = 66f66731a3abd1290f67d62f9ef654f68756bccb +SHA1 (patch-sysdeps_freebsd_procwd.c) = 89961a4115785809b1a1dc5dd07f263cf35cf1b8 diff --git a/sysutils/libgtop/patches/patch-sysdeps_freebsd_procwd.c b/sysutils/libgtop/patches/patch-sysdeps_freebsd_procwd.c new file mode 100644 index 00000000000..f1794bd9b08 --- /dev/null +++ b/sysutils/libgtop/patches/patch-sysdeps_freebsd_procwd.c @@ -0,0 +1,38 @@ +$NetBSD: patch-sysdeps_freebsd_procwd.c,v 1.1 2012/03/23 17:29:52 marino Exp $ + +--- sysdeps/freebsd/procwd.c.orig 2012-03-23 16:53:25.085432000 +0000 ++++ sysdeps/freebsd/procwd.c +@@ -100,8 +100,6 @@ parse_output(const char *output, glibtop + char** + glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) + { +- int exe_mib[4]; +- size_t len; + #if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) + struct kinfo_file *freep, *kif; + GPtrArray *dirs; +@@ -116,6 +114,16 @@ glibtop_get_proc_wd_s(glibtop *server, g + #endif + + memset (buf, 0, sizeof (glibtop_proc_wd)); ++#if defined(__DragonFly__) ++ char path[MAXPATHLEN]; ++ ++ g_snprintf(path, sizeof(path), "/proc/%u/file", pid); ++ if (safe_readlink(path, buf->exe, sizeof(buf->exe))) ++ buf->flags |= (1 << GLIBTOP_PROC_WD_EXE); ++#else ++ int exe_mib[4]; ++ size_t len; ++ + len = 0; + + exe_mib[0] = CTL_KERN; +@@ -129,6 +137,7 @@ glibtop_get_proc_wd_s(glibtop *server, g + if (sysctl(exe_mib, 4, buf->exe, &len, NULL, 0) == 0) + buf->flags |= (1 << GLIBTOP_PROC_WD_EXE); + } ++#endif + + #if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) + #ifndef HAVE_KINFO_GETFILE |