mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-06 06:49:53 +02:00
Merge pull request #454 from marckleinebudde/fix-poll-errno
Fix poll errno
This commit is contained in:
+1
-1
@@ -223,7 +223,7 @@ static void do_send()
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = poll(fds, 1, 1000);
|
err = poll(fds, 1, 1000);
|
||||||
if (err == 0 || (err == -1 && errno != -EINTR)) {
|
if (err == 0 || (err == -1 && errno != EINTR)) {
|
||||||
perror("poll()");
|
perror("poll()");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
+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