compiler warning:
expected 'struct timeval * restrict' but argument is of type 'const struct timeval *'
On Linux, select() modifies timeout, so the timeout cannot be 'const'.
Signed-off-by: Karel Zak <kzak@redhat.com>
break;
}
#else
- select(0, NULL, NULL, NULL, delay);
+ {
+ struct timeval timeout;
+
+ /* On Linux, select() modifies timeout */
+ memcpy(&timeout, delay, sizeof(struct timeval));
+ select(0, NULL, NULL, NULL, &timeout);
+ }
#endif
}