diff options
author | nicm <nicm> | 2020-05-16 16:07:55 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-05-16 16:07:55 +0000 |
commit | dceb6a15d04a2b2e050ab41816d0df3fe224b416 (patch) | |
tree | c2810c4472b71fd21301b6391e1a38a4e0774777 /tty.c | |
parent | 126bacb473f7950a156944caba42fad5f1764287 (diff) | |
download | rtmux-dceb6a15d04a2b2e050ab41816d0df3fe224b416.tar.gz rtmux-dceb6a15d04a2b2e050ab41816d0df3fe224b416.tar.bz2 rtmux-dceb6a15d04a2b2e050ab41816d0df3fe224b416.zip |
Add a -D flag to ask tmux not to daemonize, useful both for running a
debugger (lldb does not have follow-fork-mode) and for running with a
managed supervisor init system. GitHub issue 2190.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -154,16 +154,21 @@ tty_read_callback(__unused int fd, __unused short events, void *data) { 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)", c->name, nread, size); + log_debug("%s: read %d bytes (already %zu)", name, nread, size); while (tty_keys_next(tty)) ; |