mirror of
https://github.com/laanwj/k210-sdk-stuff.git
synced 2024-11-22 01:16:20 +04:00
linux: Set timeout argument on poll() properly
`0` for the timeout means *return immediately* instead of *wait forever*. This is absolutely unnecessary, so change the argument to `-1` which does mean *wait until something happens*.
This commit is contained in:
parent
aab7c0a84b
commit
7cbb10693e
@ -540,7 +540,7 @@ int main(int argc, char **argv)
|
|||||||
fds[i].revents = 0;
|
fds[i].revents = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poll(fds, 2, 0) < 0) {
|
if (poll(fds, 2, -1) < 0) {
|
||||||
perror("poll");
|
perror("poll");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
|
|||||||
fds[i].revents = 0;
|
fds[i].revents = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poll(fds, 2, 0) < 0) {
|
if (poll(fds, 2, -1) < 0) {
|
||||||
fprintf(stderr, "Poll error: %s\n", strerror(errno));
|
fprintf(stderr, "Poll error: %s\n", strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user