diff options
author | nicm <nicm> | 2019-12-12 11:39:56 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-12-12 11:39:56 +0000 |
commit | c284ebe0ade7cc85ad6c3fe5ce7ed5108119222d (patch) | |
tree | 52fa29b04da1e5468bdce23cce61bf0370923c2e /server-fn.c | |
parent | 64fb7e472a9e627ee486707ab9d30b607d76478a (diff) | |
download | rtmux-c284ebe0ade7cc85ad6c3fe5ce7ed5108119222d.tar.gz rtmux-c284ebe0ade7cc85ad6c3fe5ce7ed5108119222d.tar.bz2 rtmux-c284ebe0ade7cc85ad6c3fe5ce7ed5108119222d.zip |
Rewrite the code for reading and writing files. Now, if the client is
not attached, the server process asks it to open the file, similar to
how works for stdin, stdout, stderr. This makes special files like
/dev/fd/X work (used by some shells). stdin, stdout and stderr and
control mode are now just special cases of the same mechanism. This will
also make it easier to use for other commands that read files such as
source-file.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/server-fn.c b/server-fn.c index 25d3aeb1..aa4a482b 100644 --- a/server-fn.c +++ b/server-fn.c @@ -439,36 +439,6 @@ server_check_unattached(void) } } -int -server_set_stdin_callback(struct client *c, void (*cb)(struct client *, int, - void *), void *cb_data, char **cause) -{ - if (c == NULL || c->session != NULL) { - *cause = xstrdup("no client with stdin"); - return (-1); - } - if (c->flags & CLIENT_TERMINAL) { - *cause = xstrdup("stdin is a tty"); - return (-1); - } - if (c->stdin_callback != NULL) { - *cause = xstrdup("stdin is in use"); - return (-1); - } - - c->stdin_callback_data = cb_data; - c->stdin_callback = cb; - - c->references++; - - if (c->stdin_closed) - c->stdin_callback(c, 1, c->stdin_callback_data); - - proc_send(c->peer, MSG_STDIN, -1, NULL, 0); - - return (0); -} - void server_unzoom_window(struct window *w) { |