From 87e6af10256cae381098230cf92aa6af7ca52697 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 28 Aug 2023 16:09:25 +0200 Subject: [PATCH] j1939cat: do_send(): fix errno check "errno" hold the positive error value. Link: https://github.com/linux-can/can-utils/issues/448 Fixes: cc155d2f63da ("j1939cat: make use of new RX UAPI") Fixes: 19d41bec457b ("jcat: allow to re-send rest of the buffer if we was interrupted") Signed-off-by: Marc Kleine-Budde --- j1939cat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/j1939cat.c b/j1939cat.c index 4234aad..3383888 100644 --- a/j1939cat.c +++ b/j1939cat.c @@ -369,7 +369,7 @@ static int j1939cat_send_loop(struct j1939cat_priv *priv, int out_fd, char *buf, ret = poll(&fds, 1, priv->polltimeout); if (ret == -1) { - if (errno == -EINTR) + if (errno == EINTR) continue; else return -errno; @@ -575,7 +575,7 @@ static int j1939cat_recv(struct j1939cat_priv *priv) ret = poll(&fds, 1, priv->polltimeout); if (ret == -1) { - if (errno == -EINTR) + if (errno == EINTR) continue; else return -errno;