=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.374 retrieving revision 1.375 diff -c -r1.374 -r1.375 *** src/usr.bin/tmux/tty.c 2020/05/16 15:36:57 1.374 --- src/usr.bin/tmux/tty.c 2020/05/16 16:07:55 1.375 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.374 2020/05/16 15:36:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.375 2020/05/16 16:07:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 154,169 **** { struct tty *tty = data; struct client *c = tty->client; size_t size = EVBUFFER_LENGTH(tty->in); int nread; nread = evbuffer_read(tty->in, tty->fd, -1); if (nread == 0 || nread == -1) { event_del(&tty->event_in); server_client_lost(tty->client); return; } ! log_debug("%s: read %d bytes (already %zu)", c->name, nread, size); while (tty_keys_next(tty)) ; --- 154,174 ---- { struct tty *tty = data; struct client *c = tty->client; + const char *name = c->name; size_t size = EVBUFFER_LENGTH(tty->in); int nread; nread = evbuffer_read(tty->in, tty->fd, -1); if (nread == 0 || nread == -1) { + if (nread == 0) + log_debug("%s: read closed", name); + else + log_debug("%s: read error: %s", name, strerror(errno)); event_del(&tty->event_in); server_client_lost(tty->client); return; } ! log_debug("%s: read %d bytes (already %zu)", name, nread, size); while (tty_keys_next(tty)) ;