aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-07-12 22:21:42 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-07-12 22:21:42 +0100
commite8567098a4eaa81306effeaef430d9d74f603f7a (patch)
treefa21f9295cf88217e055b4029e31befb413a7820 /client.c
parentbdea2f9eda1abc8f4a6c423af62ef7538b2ad249 (diff)
downloadrtmux-e8567098a4eaa81306effeaef430d9d74f603f7a.tar.gz
rtmux-e8567098a4eaa81306effeaef430d9d74f603f7a.tar.bz2
rtmux-e8567098a4eaa81306effeaef430d9d74f603f7a.zip
Add support for Cgywin, apparently it is enough just to open the tty again in
the server and fd passing is not necessary. Needs some ifdefs unfortunately but no way around that and some of them can go next time we're willing to do a protocol bump. Patch from J Raynor jxraynor at gmail dot com.
Diffstat (limited to 'client.c')
-rw-r--r--client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/client.c b/client.c
index 691ace31..b9e3b30a 100644
--- a/client.c
+++ b/client.c
@@ -328,8 +328,13 @@ client_send_identify(int flags)
strlcpy(data.term, term, sizeof data.term) >= sizeof data.term)
*data.term = '\0';
+#ifdef __CYGWIN__
+ snprintf(&data.ttyname, sizeof data.ttyname, "%s",
+ ttyname(STDIN_FILENO));
+#else
if ((fd = dup(STDIN_FILENO)) == -1)
fatal("dup failed");
+#endif
imsg_compose(&client_ibuf,
MSG_IDENTIFY, PROTOCOL_VERSION, -1, fd, &data, sizeof data);
client_update_event();