The branch, master has been updated
via 12e9c974fadc5ed6f0e7db10c40d5a0d55e0da8a (commit)
via 024846b4d82ad57e68b64cac2ac12b932a9042d2 (commit)
from 248ad8bdb2778ca19748441efb15c5b274256ace (commit)
- Log -----------------------------------------------------------------
commit 12e9c974fadc5ed6f0e7db10c40d5a0d55e0da8a
Merge: 024846b 248ad8b
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 024846b4d82ad57e68b64cac2ac12b932a9042d2
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>
If pgrp fails in osdep_get_cwd, try sid. Fixes eg cat foo|less. From Balazs
Kezes.
---
osdep-linux.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/osdep-linux.c b/osdep-linux.c
index ccac267..46aea68 100644
--- a/osdep-linux.c
+++ b/osdep-linux.c
@@ -65,7 +65,7 @@ osdep_get_cwd(int fd)
{
static char target[MAXPATHLEN + 1];
char *path;
- pid_t pgrp;
+ pid_t pgrp, sid;
ssize_t n;
if ((pgrp = tcgetpgrp(fd)) == -1)
@@ -74,6 +74,13 @@ osdep_get_cwd(int fd)
xasprintf(&path, "/proc/%lld/cwd", (long long) pgrp);
n = readlink(path, target, MAXPATHLEN);
free(path);
+
+ if (n == -1 && ioctl(fd, TIOCGSID, &sid) != -1) {
+ xasprintf(&path, "/proc/%lld/cwd", (long long) sid);
+ n = readlink(path, target, MAXPATHLEN);
+ free(path);
+ }
+
if (n > 0) {
target[n] = '\0';
return (target);
-----------------------------------------------------------------------
Summary of changes:
osdep-linux.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
hooks/post-receive
--
tmux
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs