X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/6262005e88c7c9edff4c0f962ca338ffb2a299fb..560c3078a267674e487703a50c90bc177e95e731:/hmland.c diff --git a/hmland.c b/hmland.c index c50022c..f3b7cf9 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); + } + } } } } @@ -603,7 +610,7 @@ static int socket_server(char *iface, int port, int flags) sin.sin_addr.s_addr = htonl(INADDR_ANY); } else { if (inet_pton(AF_INET, iface, &(sin.sin_addr.s_addr)) != 1) { - perror("inet_ntop"); + fprintf(stderr, "Can't convert IP %s, aborting!\n", iface); return EXIT_FAILURE; } }