forked from lix-project/lix
* Handle EINTR in select().
This commit is contained in:
parent
27bb0ac7d2
commit
ddde8e2f32
|
@ -69,9 +69,9 @@ static bool isFarSideClosed(int socket)
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
FD_SET(socket, &fds);
|
FD_SET(socket, &fds);
|
||||||
|
|
||||||
if (select(socket + 1, &fds, 0, 0, &timeout) == -1)
|
while (select(socket + 1, &fds, 0, 0, &timeout) == -1)
|
||||||
throw SysError("select()");
|
if (errno != EINTR) throw SysError("select()");
|
||||||
|
|
||||||
if (!FD_ISSET(socket, &fds)) return false;
|
if (!FD_ISSET(socket, &fds)) return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue