Add some debug for flush

pull/126/head
Michael Black 2019-09-09 12:49:11 -05:00
rodzic 5d16de90ee
commit fab30e07c1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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;
}