Mercurial > libavformat.hg
changeset 5896:395592984ef0 libavformat
Don't report EINTR from select as an error, retry select instead
author | mstorsjo |
---|---|
date | Fri, 26 Mar 2010 16:04:38 +0000 |
parents | d8031a05ceec |
children | d7f41380f52c |
files | rtpproto.c tcp.c udp.c |
diffstat | 3 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rtpproto.c Fri Mar 26 01:12:14 2010 +0000 +++ b/rtpproto.c Fri Mar 26 16:04:38 2010 +0000 @@ -251,6 +251,8 @@ break; } } else if (n < 0) { + if (ff_neterrno() == FF_NETERROR(EINTR)) + continue; return AVERROR(EIO); } }
--- a/tcp.c Fri Mar 26 01:12:14 2010 +0000 +++ b/tcp.c Fri Mar 26 16:04:38 2010 +0000 @@ -147,6 +147,8 @@ return AVERROR(ff_neterrno()); } else return len; } else if (ret < 0) { + if (ff_neterrno() == FF_NETERROR(EINTR)) + continue; return -1; } } @@ -180,6 +182,8 @@ size -= len; buf += len; } else if (ret < 0) { + if (ff_neterrno() == FF_NETERROR(EINTR)) + continue; return -1; } }
--- a/udp.c Fri Mar 26 01:12:14 2010 +0000 +++ b/udp.c Fri Mar 26 16:04:38 2010 +0000 @@ -437,8 +437,11 @@ tv.tv_sec = 0; tv.tv_usec = 100 * 1000; 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); + } if (!(ret > 0 && FD_ISSET(s->udp_fd, &rfds))) continue; len = recv(s->udp_fd, buf, size, 0);