j1939cat: do_send(): fix errno check
"errno" hold the positive error value. Link: https://github.com/linux-can/can-utils/issues/448 Fixes:pull/454/headcc155d2f63("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>
parent
87a6788e6d
commit
87e6af1025
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue