mirror of
https://github.com/tmux/tmux.git
synced 2024-11-06 02:48:49 +00:00
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
This commit is contained in:
commit
e44bdcce4c
@ -69,10 +69,19 @@ osdep_get_cwd(int fd)
|
|||||||
{
|
{
|
||||||
static char target[MAXPATHLEN + 1];
|
static char target[MAXPATHLEN + 1];
|
||||||
char *path;
|
char *path;
|
||||||
|
const char *ttypath;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
pid_t pgrp;
|
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);
|
return (NULL);
|
||||||
|
|
||||||
xasprintf(&path, "/proc/%u/path/cwd", (u_int) pgrp);
|
xasprintf(&path, "/proc/%u/path/cwd", (u_int) pgrp);
|
||||||
|
@ -550,7 +550,7 @@ server_client_check_resize(struct window_pane *wp)
|
|||||||
* other platforms and ignoring it doesn't seem to cause any
|
* other platforms and ignoring it doesn't seem to cause any
|
||||||
* issues.
|
* issues.
|
||||||
*/
|
*/
|
||||||
if (errno != EINVAL)
|
if (errno != EINVAL && errno != ENXIO)
|
||||||
#endif
|
#endif
|
||||||
fatal("ioctl failed");
|
fatal("ioctl failed");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user