X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/04e76de638c84c3cb88a7178764b700d5097e607..1e79d00a9f4c2f059c8bd2dc22e601c4ed4065d6:/hmland.c diff --git a/hmland.c b/hmland.c index c50022c..32a1cdf 100644 --- a/hmland.c +++ b/hmland.c @@ -478,11 +478,18 @@ static int comm(int fd_in, int fd_out, int master_socket, int flags) } } else if (fd == -1) { if (errno) { - perror("hmcfgusb_poll"); - quit = 1; - } else { - /* periodically wakeup the device */ - hmcfgusb_send_null_frame(dev, 1); + if (errno != ETIMEDOUT) { + perror("hmcfgusb_poll"); + quit = 1; + } else { + /* periodically wakeup the device */ + hmcfgusb_send_null_frame(dev, 1); + if (wait_for_h) { + memset(out, 0, sizeof(out)); + out[0] = 'K'; + hmcfgusb_send(dev, out, sizeof(out), 1); + } + } } } }