diff options
author | Thomas Adam <thomas@xteddy.org> | 2012-09-24 17:55:06 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2012-09-24 17:55:06 +0100 |
commit | e342304134b8012ae62cb627dc9e322411dd48b1 (patch) | |
tree | 822f7301a0a7ee9f46a1906e6b565bb490c2b7dd /osdep-openbsd.c | |
parent | d785c37ee277457433daf1553424b1d815f9e2f9 (diff) | |
parent | 84612a8196341839c5a18362b68047aa1b011a50 (diff) | |
download | rtmux-e342304134b8012ae62cb627dc9e322411dd48b1.tar.gz rtmux-e342304134b8012ae62cb627dc9e322411dd48b1.tar.bz2 rtmux-e342304134b8012ae62cb627dc9e322411dd48b1.zip |
Merge branch 'obsd-master'
Conflicts:
cmd.c
format.c
osdep-openbsd.c
tmux.h
Diffstat (limited to 'osdep-openbsd.c')
-rw-r--r-- | osdep-openbsd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/osdep-openbsd.c b/osdep-openbsd.c index 4fb75bff..402b501c 100644 --- a/osdep-openbsd.c +++ b/osdep-openbsd.c @@ -137,10 +137,12 @@ error: char* osdep_get_cwd(pid_t pid) { - int name[] = { CTL_KERN, KERN_PROC_CWD, (int)pid }; + int name[] = { CTL_KERN, KERN_PROC_CWD, 0 }; static char path[MAXPATHLEN]; size_t pathlen = sizeof path; + if ((name[2] = tcgetpgrp(fd)) == -1) + return (NULL); if (sysctl(name, 3, path, &pathlen, NULL, 0) != 0) return (NULL); return (path); |