mirror of
https://github.com/intrepidcs/icsscand.git
synced 2026-08-05 09:38:17 +02:00
Set timeout tv_sec instead of tv_usec for compatibility with older kernels
This commit is contained in:
+2
-3
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user