mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Pass the stdout file descriptor from the client as well as stdin and use
them for control clients directly instead of passing everything via the client.
This commit is contained in:
8
file.c
8
file.c
@ -242,7 +242,9 @@ file_write(struct client *c, const char *path, int flags, const void *bdata,
|
||||
cf->path = xstrdup("-");
|
||||
|
||||
fd = STDOUT_FILENO;
|
||||
if (c == NULL || c->flags & CLIENT_ATTACHED) {
|
||||
if (c == NULL ||
|
||||
(c->flags & CLIENT_ATTACHED) ||
|
||||
(c->flags & CLIENT_CONTROL)) {
|
||||
cf->error = EBADF;
|
||||
goto done;
|
||||
}
|
||||
@ -311,7 +313,9 @@ file_read(struct client *c, const char *path, client_file_cb cb, void *cbdata)
|
||||
cf->path = xstrdup("-");
|
||||
|
||||
fd = STDIN_FILENO;
|
||||
if (c == NULL || c->flags & CLIENT_ATTACHED) {
|
||||
if (c == NULL ||
|
||||
(c->flags & CLIENT_ATTACHED) ||
|
||||
(c->flags & CLIENT_CONTROL)) {
|
||||
cf->error = EBADF;
|
||||
goto done;
|
||||
}
|
||||
|
Reference in New Issue
Block a user