Commit cae9a15c authored by Martin Storsjö's avatar Martin Storsjö

Don't report EINTR from select as an error, retry select instead

Originally committed as revision 22694 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 3fd427cd
...@@ -251,6 +251,8 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size) ...@@ -251,6 +251,8 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
break; break;
} }
} else if (n < 0) { } else if (n < 0) {
if (ff_neterrno() == FF_NETERROR(EINTR))
continue;
return AVERROR(EIO); return AVERROR(EIO);
} }
} }
......
...@@ -147,6 +147,8 @@ static int tcp_read(URLContext *h, uint8_t *buf, int size) ...@@ -147,6 +147,8 @@ static int tcp_read(URLContext *h, uint8_t *buf, int size)
return AVERROR(ff_neterrno()); return AVERROR(ff_neterrno());
} else return len; } else return len;
} else if (ret < 0) { } else if (ret < 0) {
if (ff_neterrno() == FF_NETERROR(EINTR))
continue;
return -1; return -1;
} }
} }
...@@ -180,6 +182,8 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size) ...@@ -180,6 +182,8 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size)
size -= len; size -= len;
buf += len; buf += len;
} else if (ret < 0) { } else if (ret < 0) {
if (ff_neterrno() == FF_NETERROR(EINTR))
continue;
return -1; return -1;
} }
} }
......
...@@ -437,8 +437,11 @@ static int udp_read(URLContext *h, uint8_t *buf, int size) ...@@ -437,8 +437,11 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 100 * 1000; tv.tv_usec = 100 * 1000;
ret = select(s->udp_fd + 1, &rfds, NULL, NULL, &tv); ret = select(s->udp_fd + 1, &rfds, NULL, NULL, &tv);
if (ret < 0) if (ret < 0) {
if (ff_neterrno() == FF_NETERROR(EINTR))
continue;
return AVERROR(EIO); return AVERROR(EIO);
}
if (!(ret > 0 && FD_ISSET(s->udp_fd, &rfds))) if (!(ret > 0 && FD_ISSET(s->udp_fd, &rfds)))
continue; continue;
len = recv(s->udp_fd, buf, size, 0); len = recv(s->udp_fd, buf, size, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment