diff --git a/client.c b/client.c index cb546c40..90993057 100644 --- a/client.c +++ b/client.c @@ -281,7 +281,6 @@ client_main(int argc, char **argv, int flags) /* Set the event and dispatch. */ client_update_event(); - event_add (&client_stdin, NULL); event_dispatch(); /* Print the exit message, if any, and exit. */ @@ -516,6 +515,12 @@ client_dispatch_wait(void *data) event_del(&client_stdin); client_attached = 1; break; + case MSG_STDIN: + if (datalen != 0) + fatalx("bad MSG_STDIN size"); + + event_add(&client_stdin, NULL); + break; case MSG_STDOUT: if (datalen != sizeof stdoutdata) fatalx("bad MSG_STDOUT"); diff --git a/server-fn.c b/server-fn.c index bea64178..c22095dc 100644 --- a/server-fn.c +++ b/server-fn.c @@ -581,5 +581,8 @@ server_set_stdin_callback(struct client *c, void (*cb)(struct client *, int, if (c->stdin_closed) c->stdin_callback (c, 1, c->stdin_callback_data); + + server_write_client(c, MSG_STDIN, NULL, 0); + return (0); }