Set timeout tv_sec instead of tv_usec for compatibility with older kernels

checksum-failure-logging
Paul Hollinsky 2019-08-27 15:16:27 -04:00
parent 318af6b4f3
commit cfe6e7a832
1 changed files with 2 additions and 3 deletions

View File

@ -451,9 +451,8 @@ int main(int argc, char** argv) {
FD_ZERO(&fds); FD_ZERO(&fds);
FD_SET(driver, &fds); FD_SET(driver, &fds);
struct timeval timeout; struct timeval timeout = {};
timeout.tv_sec = 0; timeout.tv_sec = 1;
timeout.tv_usec = 1000 * 1000; // 1s
auto ret = select(driver + 1, &fds, NULL, NULL, &timeout); auto ret = select(driver + 1, &fds, NULL, NULL, &timeout);
if(ret == -1) { if(ret == -1) {