From cfe6e7a83277021946ed8569837979676bd38000 Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Tue, 27 Aug 2019 15:16:27 -0400 Subject: [PATCH] Set timeout tv_sec instead of tv_usec for compatibility with older kernels --- src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8b62624..3e50184 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -451,9 +451,8 @@ int main(int argc, char** argv) { FD_ZERO(&fds); FD_SET(driver, &fds); - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 1000 * 1000; // 1s + struct timeval timeout = {}; + timeout.tv_sec = 1; auto ret = select(driver + 1, &fds, NULL, NULL, &timeout); if(ret == -1) {