From 09e96e72f72d325715f668d4a6a4d865d1affead Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Thu, 21 Mar 2019 08:42:33 +0100 Subject: [PATCH] Add some more debug --- ttynvt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ttynvt.c b/ttynvt.c index eab2eba..93562c9 100644 --- a/ttynvt.c +++ b/ttynvt.c @@ -289,10 +289,11 @@ static void *_read_net(void *arg) tty->fds[FD_MASTER].events = tty->master_suspended ? POLLPRI : POLLIN; res = poll(tty->fds, 3, -1); - DBG2("%s: res=%d events-N/M/S=%#x/%#x/%#x\n", __func__, - res, - tty->fds[FD_NET].revents, tty->fds[FD_MASTER].revents, - tty->fds[FD_SLAVE].revents); + DBG2("%s: res=%d events-N/M/S=%x:%x/%x:%x/%x:%x SS=%d MS=%d\n", + __func__, res, tty->fds[FD_NET].events, tty->fds[FD_NET].revents, + tty->fds[FD_MASTER].events, tty->fds[FD_MASTER].revents, + tty->fds[FD_SLAVE].events, tty->fds[FD_SLAVE].revents, + tty->slave_suspended, tty->master_suspended); if (res < 0) { if (errno == EINTR) @@ -339,6 +340,7 @@ static void *_read_net(void *arg) if ((tty->fds[FD_MASTER].revents & POLLIN) && !tty->master_suspended) { res = read(tty->fds[FD_MASTER].fd, buf, TMP_BUF_SIZE); + DBG("%s: read res=%d pollout=%d\n", __func__, res, tty->pollout); if (res < 0) { _log(LOG_ERR, "master read error: %m\n"); @@ -477,6 +479,8 @@ static void _modem_status_cb(void *cctx, int status) mcr |= TIOCM_CTS; tty->master_suspended = (mcr & TIOCM_CTS) ? 0 : 1; + DBG("%s: tty=%p mcr=%x MS=%d\n", __func__, tty, mcr, + tty->master_suspended); pthread_mutex_lock(&tty->tty_lock); tty->smcr_last = tty->smcr;