pty: buffer data between pty and child
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 28 Jan 2012 16:17:20 +0000 (17:17 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 28 Jan 2012 16:17:20 +0000 (17:17 +0100)
commit229b4bfde246e0bf125c41538d7da850f46efca2
tree38d764890b86baaeb10a607a4522b06dacca567d
parent2c8622d4680c70b63c86a5ace68524d103a200d5
pty: buffer data between pty and child

If the child returns EWOULDBLOCK on write we need to save the input in a
buffer to avoid loosing data. We need to work in non-blocking mode to
avoid UI hangs so we simply use the new ring-buffer object to store
data.

This also changes the callback behavior. The pty is no longer closed
implicitely so the owner must call pty_close now even if the close
callback is called. This avoids circular callbacks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/pty.c
src/pty.h
src/terminal.c