diff options
author | nicm <nicm> | 2020-04-27 08:35:09 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-04-27 08:35:09 +0000 |
commit | 1574126e8a424a442b66b4bd778539b571eebfcf (patch) | |
tree | 6624c8aaeed1876b2a25c3dc59bdc0f4915e9bbf /client.c | |
parent | 18886cb510b26a8db0d39c39e8682843bbac7d20 (diff) | |
download | rtmux-1574126e8a424a442b66b4bd778539b571eebfcf.tar.gz rtmux-1574126e8a424a442b66b4bd778539b571eebfcf.tar.bz2 rtmux-1574126e8a424a442b66b4bd778539b571eebfcf.zip |
Do not close the stdout file descriptor in control mode as it will be
needed for printing the exit messages. Fixes a bug when detaching with
iTerm2.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -518,7 +518,7 @@ client_write_open(void *data, size_t datalen) errno = EBADF; else { cf->fd = dup(msg->fd); - if (client_flags & CLIENT_CONTROL) + if (~client_flags & CLIENT_CONTROL) close(msg->fd); /* can only be used once */ } } @@ -673,7 +673,8 @@ client_read_open(void *data, size_t datalen) errno = EBADF; else { cf->fd = dup(msg->fd); - close(msg->fd); /* can only be used once */ + if (~client_flags & CLIENT_CONTROL) + close(msg->fd); /* can only be used once */ } } if (cf->fd == -1) { |