From fab30e07c1b6d916f3b35f44d417670ef13cbe0c Mon Sep 17 00:00:00 2001 From: Michael Black Date: Mon, 9 Sep 2019 12:49:11 -0500 Subject: [PATCH] Add some debug for flush --- src/serial.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serial.c b/src/serial.c index b34b68c48..6f3716aba 100644 --- a/src/serial.c +++ b/src/serial.c @@ -568,11 +568,14 @@ int HAMLIB_API serial_flush(hamlib_port_t *p) * if fd corresponds to a microHam device drain the line * (which is a socket) by reading until it is empty. */ - while (read(p->fd, buf, 32) > 0) { + int n; + while ((n=read(p->fd, buf, 32)) > 0) { + rig_debug(RIG_DEBUG_VERBOSE, "%s: flushed %d bytes\n", __func__, n); /* do nothing */ } return RIG_OK; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: tcflush\n", __func__); tcflush(p->fd, TCIFLUSH); return RIG_OK; }