summaryrefslogtreecommitdiff
path: root/misc/tmux
diff options
context:
space:
mode:
authorleot <leot@pkgsrc.org>2019-06-15 09:42:52 +0000
committerleot <leot@pkgsrc.org>2019-06-15 09:42:52 +0000
commit380f26026658a8d0e76c0cf48f5e39d60c014573 (patch)
tree42864351de58a9145830d889da2b5fe47bd25617 /misc/tmux
parent7973a75c005b45d76d22450f586057989ee6b72b (diff)
downloadpkgsrc-380f26026658a8d0e76c0cf48f5e39d60c014573.tar.gz
tmux: Add KERN_PROC_CWD support on NetBSD
If KERN_PROC_CWD is available use it instead of using procfs. PKGREVISION++
Diffstat (limited to 'misc/tmux')
-rw-r--r--misc/tmux/Makefile3
-rw-r--r--misc/tmux/distinfo3
-rw-r--r--misc/tmux/patches/patch-osdep-netbsd.c40
3 files changed, 44 insertions, 2 deletions
diff --git a/misc/tmux/Makefile b/misc/tmux/Makefile
index a022909db17..5ab31b52e9c 100644
--- a/misc/tmux/Makefile
+++ b/misc/tmux/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.48 2019/05/03 10:49:35 triaxx Exp $
+# $NetBSD: Makefile,v 1.49 2019/06/15 09:42:52 leot Exp $
DISTNAME= tmux-2.9a
+PKGREVISION= 1
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_GITHUB:=tmux/}
GITHUB_RELEASE= ${PKGVERSION_NOREV}
diff --git a/misc/tmux/distinfo b/misc/tmux/distinfo
index 818330e2e6b..3073ba10295 100644
--- a/misc/tmux/distinfo
+++ b/misc/tmux/distinfo
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.40 2019/05/03 10:49:35 triaxx Exp $
+$NetBSD: distinfo,v 1.41 2019/06/15 09:42:52 leot Exp $
SHA1 (tmux-2.9a.tar.gz) = 33cba73e64c62f46bd244d4472c59371fb747f56
RMD160 (tmux-2.9a.tar.gz) = e5460971073abb865adcea2a6711e82d84c53838
SHA512 (tmux-2.9a.tar.gz) = aca6882688727c10c5647443fdd18bbd6c0f80b7a3bf9667903d1b89d523e604cd715f176f33f2e5673258f00e626a6dc273f80fe97ae4f91621814d89985713
Size (tmux-2.9a.tar.gz) = 510915 bytes
+SHA1 (patch-osdep-netbsd.c) = 90d335b544dbacc3860cfa6c13ecd61b11f09f30
diff --git a/misc/tmux/patches/patch-osdep-netbsd.c b/misc/tmux/patches/patch-osdep-netbsd.c
new file mode 100644
index 00000000000..f9abe28cc34
--- /dev/null
+++ b/misc/tmux/patches/patch-osdep-netbsd.c
@@ -0,0 +1,40 @@
+$NetBSD: patch-osdep-netbsd.c,v 1.4 2019/06/15 09:42:52 leot Exp $
+
+Add support for KERN_PROC_CWD.
+
+--- osdep-netbsd.c.orig 2019-03-26 14:34:58.000000000 +0000
++++ osdep-netbsd.c
+@@ -135,11 +135,24 @@ osdep_get_cwd(int fd)
+ static char target[PATH_MAX + 1];
+ char *path;
+ pid_t pgrp;
+- ssize_t n;
+
+ if ((pgrp = tcgetpgrp(fd)) == -1)
+ return (NULL);
+
++#ifdef KERN_PROC_CWD
++ int mib[4];
++ size_t len;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PROC_ARGS;
++ mib[2] = pgrp;
++ mib[3] = KERN_PROC_CWD;
++ len = sizeof(target);
++ if (sysctl(mib, 4, target, &len, NULL, 0) == 0)
++ return (target);
++#else
++ ssize_t n;
++
+ xasprintf(&path, "/proc/%lld/cwd", (long long) pgrp);
+ n = readlink(path, target, sizeof(target) - 1);
+ free(path);
+@@ -147,6 +160,7 @@ osdep_get_cwd(int fd)
+ target[n] = '\0';
+ return (target);
+ }
++#endif
+
+ return (NULL);
+ }