dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit e89ea23eafd06e58732c59b477e9df1dfd606a38
parent 7729e80cbe287a1026c2113a6e8dbc402e75249f
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 31 Oct 2014 11:23:05 +0100

Cleanup vt_write

Diffstat:
vt.c | 9++++-----
vt.h | 2+-
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/vt.c b/vt.c @@ -1635,17 +1635,16 @@ int vt_pty_get(Vt *t) return t->pty; } -int vt_write(Vt *t, const char *buf, int len) +ssize_t vt_write(Vt *t, const char *buf, size_t len) { - int ret = len; + ssize_t ret = len; while (len > 0) { - int res = write(t->pty, buf, len); + ssize_t res = write(t->pty, buf, len); if (res < 0) { if (errno != EAGAIN && errno != EINTR) return -1; - else - continue; + continue; } buf += res; len -= res; diff --git a/vt.h b/vt.h @@ -47,7 +47,7 @@ bool vt_cursor_visible(Vt*); int vt_process(Vt *); void vt_keypress(Vt *, int keycode); -int vt_write(Vt*, const char *buf, int len); +ssize_t vt_write(Vt*, const char *buf, size_t len); void vt_mouse(Vt*, int x, int y, mmask_t mask); void vt_dirty(Vt*); void vt_draw(Vt*, WINDOW *win, int startrow, int startcol);