From c06c9c730fbe4033b038e36cb14a8382dd8f32b5 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 12 Sep 2021 09:52:46 +0100 Subject: [PATCH] Fill in missing implementation of pty_sendbuffer. Going through all the backends' send() and sendbuffer() routines, I noticed that the Unix pty backend is the only one where the return value from send() doesn't match what sendbuffer() would tell you, apparently because sendbuffer() was a stub implementation that I never got round to filling in properly. But pty masters _can_ back up, and if they do, we should return the appropriate data. --- unix/pty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/pty.c b/unix/pty.c index abafa108..8321f982 100644 --- a/unix/pty.c +++ b/unix/pty.c @@ -1414,8 +1414,8 @@ static void pty_close(Pty *pty) */ static size_t pty_sendbuffer(Backend *be) { - /* Pty *pty = container_of(be, Pty, backend); */ - return 0; + Pty *pty = container_of(be, Pty, backend); + return bufchain_size(&pty->output_data); } /*