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:
Wladimir J. van der Laan 2020-02-22 12:22:25 +00:00
parent aab7c0a84b
commit 7cbb10693e
2 changed files with 2 additions and 2 deletions

View File

@ -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);
} }

View File

@ -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);
} }