mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
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>
This commit is contained in:
+2
-2
@@ -369,7 +369,7 @@ static int j1939cat_send_loop(struct j1939cat_priv *priv, int out_fd, char *buf,
|
|||||||
|
|
||||||
ret = poll(&fds, 1, priv->polltimeout);
|
ret = poll(&fds, 1, priv->polltimeout);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
if (errno == -EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
return -errno;
|
return -errno;
|
||||||
@@ -575,7 +575,7 @@ static int j1939cat_recv(struct j1939cat_priv *priv)
|
|||||||
|
|
||||||
ret = poll(&fds, 1, priv->polltimeout);
|
ret = poll(&fds, 1, priv->polltimeout);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
if (errno == -EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|||||||
Reference in New Issue
Block a user