No longer needed, committed to misc/tmux - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
(HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) changeset 93d2f0b54bde953ddd458fefa6fd1247bbf0bfbb
(DIR) parent 830c9b6c44cb34ca9ad2bd28e235ef0f12b3eb59
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Wed, 28 Nov 2018 15:50:24
No longer needed, committed to misc/tmux
Diffstat:
misc/tmux/patch-osdep-netbsd.c | 43 ------------------------------------------
1 files changed, 0 insertions(+), 43 deletions(-)
---
diff -r 830c9b6c44cb -r 93d2f0b54bde misc/tmux/patch-osdep-netbsd.c
--- a/misc/tmux/patch-osdep-netbsd.c Fri Nov 16 14:16:06 2018 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-$NetBSD$
-
-Implement osdep_get_cwd() via mount_procfs(8) (inspired by osdep-sunos.c).
-
---- osdep-netbsd.c.orig 2016-01-21 00:00:28.000000000 +0000
-+++ osdep-netbsd.c
-@@ -23,10 +23,13 @@
-
- #include <errno.h>
- #include <event.h>
-+#include <limits.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
-
-+#include "tmux.h"
-+
- #define is_runnable(p) \
- ((p)->p_stat == LSRUN || (p)->p_stat == SIDL)
- #define is_stopped(p) \
-@@ -127,6 +130,22 @@ error:
- char *
- 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);
-+
-+ xasprintf(&path, "/proc/%lld/cwd", (long long) pgrp);
-+ n = readlink(path, target, sizeof(target) - 1);
-+ free(path);
-+ if (n > 0) {
-+ target[n] = '\0';
-+ return (target);
-+ }
-+
- return (NULL);
- }
-