Set timeout tv_sec instead of tv_usec for compatibility with older kernels
parent
318af6b4f3
commit
cfe6e7a832
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue