aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-08-01 23:42:39 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-08-01 23:42:39 +0100
commit3a13e066ba184b1051167b0675bf9b4364af021e (patch)
tree032af5c088c59484f6457f74d6f50dffacebe18b
parentbcd9bcae2a9aa3a2553f546107b99431dbb6931f (diff)
downloadrtmux-3a13e066ba184b1051167b0675bf9b4364af021e.tar.gz
rtmux-3a13e066ba184b1051167b0675bf9b4364af021e.tar.bz2
rtmux-3a13e066ba184b1051167b0675bf9b4364af021e.zip
Allow the file descriptor received from the client to be -1 - it can be on
Cygwin when stdin is not a terminal. Reported by A Young, SF bug 52.
-rw-r--r--server-client.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c
index 5923eb0e..fa4d2688 100644
--- a/server-client.c
+++ b/server-client.c
@@ -829,9 +829,6 @@ server_client_msg_dispatch(struct client *c)
#ifdef __CYGWIN__
imsg.fd = open(identifydata.ttyname, O_RDWR|O_NOCTTY);
#endif
- if (imsg.fd == -1)
- fatalx("MSG_IDENTIFY missing fd");
-
server_client_msg_identify(c, &identifydata, imsg.fd);
break;
case MSG_STDIN:
@@ -975,6 +972,8 @@ server_client_msg_identify(
return;
}
+ if (fd == -1)
+ return;
if (!isatty(fd)) {
close(fd);
return;