cangen: 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:31:24 +01:00
parent 4858b2b307
commit c142ca63c9
1 changed files with 1 additions and 1 deletions

View File

@ -504,7 +504,7 @@ resend:
} }
if (polltimeout) { if (polltimeout) {
/* wait for the write socket (with timeout) */ /* wait for the write socket (with timeout) */
if (poll(&fds, 1, polltimeout) < 0) { if (poll(&fds, 1, polltimeout) <= 0) {
perror("poll"); perror("poll");
return 1; return 1;
} }