From 7af4264a13c6c100db845f88e2a356861f3eb825 Mon Sep 17 00:00:00 2001 From: Stefan Herbrechtsmeier Date: Thu, 27 Jan 2022 14:35:14 +0100 Subject: [PATCH] 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 --- cansequence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cansequence.c b/cansequence.c index 3f22415..78cf5a5 100644 --- a/cansequence.c +++ b/cansequence.c @@ -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); }