cansequence: exit program with failure in case of poll timeout

The poll function returns 0 to indicate a call timed out.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
pull/336/head
Stefan Herbrechtsmeier 2022-01-27 14:35:14 +01:00
parent 3342eb42e7
commit 7af4264a13
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ static void do_send()
} }
err = poll(fds, 1, 1000); err = poll(fds, 1, 1000);
if (err == -1 && errno != -EINTR) { if (err == 0 || (err == -1 && errno != -EINTR)) {
perror("poll()"); perror("poll()");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }