Skip to content

Commit

Permalink
cansequence: exit program with failure in case of poll timeout
Browse files Browse the repository at this point in the history
The poll function returns 0 to indicate a call timed out.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
  • Loading branch information
herbrechtsmeier committed Jan 27, 2022
1 parent 3342eb4 commit 7af4264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cansequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static void do_send()
}

err = poll(fds, 1, 1000);
if (err == -1 && errno != -EINTR) {
if (err == 0 || (err == -1 && errno != -EINTR)) {
perror("poll()");
exit(EXIT_FAILURE);
}
Expand Down

0 comments on commit 7af4264

Please sign in to comment.