aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-10-16 16:52:49 +0100
committerThomas Adam <thomas@xteddy.org>2014-10-16 16:52:49 +0100
commite44bdcce4c661b52d07f30962aafa800d9ca5e28 (patch)
tree895143c6c0f288d8a837b196ce3bb7f5c6ff17cb
parent2e8f6805eb911e3de82fc43e3c90c8d425df04a8 (diff)
parentb6aef2490f086f3404f439308bb1746ec5134e9a (diff)
downloadrtmux-e44bdcce4c661b52d07f30962aafa800d9ca5e28.tar.gz
rtmux-e44bdcce4c661b52d07f30962aafa800d9ca5e28.tar.bz2
rtmux-e44bdcce4c661b52d07f30962aafa800d9ca5e28.zip
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
-rw-r--r--osdep-sunos.c11
-rw-r--r--server-client.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/osdep-sunos.c b/osdep-sunos.c
index fd644f5d..d071694e 100644
--- a/osdep-sunos.c
+++ b/osdep-sunos.c
@@ -69,10 +69,19 @@ osdep_get_cwd(int fd)
{
static char target[MAXPATHLEN + 1];
char *path;
+ const char *ttypath;
ssize_t n;
pid_t pgrp;
+ int retval, ttyfd;
- if ((pgrp = tcgetpgrp(fd)) == -1)
+ if ((ttypath = ptsname(fd)) == NULL)
+ return (NULL);
+ if ((ttyfd = open(ttypath, O_RDONLY|O_NOCTTY)) == -1)
+ return (NULL);
+
+ retval = ioctl(ttyfd, TIOCGPGRP, &pgrp);
+ close(ttyfd);
+ if (retval == -1)
return (NULL);
xasprintf(&path, "/proc/%u/path/cwd", (u_int) pgrp);
diff --git a/server-client.c b/server-client.c
index 45cc40ca..1942926b 100644
--- a/server-client.c
+++ b/server-client.c
@@ -550,7 +550,7 @@ server_client_check_resize(struct window_pane *wp)
* other platforms and ignoring it doesn't seem to cause any
* issues.
*/
- if (errno != EINVAL)
+ if (errno != EINVAL && errno != ENXIO)
#endif
fatal("ioctl failed");
}