j1939cat: do_send(): fix errno check

"errno" hold the positive error value.

Link: https://github.com/linux-can/can-utils/issues/448
Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Fixes: 19d41bec45 ("jcat: allow to re-send rest of the buffer if we was interrupted")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/454/head
Marc Kleine-Budde 2023-08-28 16:09:25 +02:00
parent 87a6788e6d
commit 87e6af1025
1 changed files with 2 additions and 2 deletions

View File

@ -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;