Skip to content

Commit

Permalink
j1939cat: do_send(): fix errno check
Browse files Browse the repository at this point in the history
"errno" hold the positive error value.

Link: linux-can#448
Fixes: cc155d2 ("j1939cat: make use of new RX UAPI")
Fixes: 19d41be ("jcat: allow to re-send rest of the buffer if we was interrupted")
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
marckleinebudde committed Aug 28, 2023
1 parent 87a6788 commit 87e6af1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions j1939cat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 87e6af1

Please sign in to comment.