diff --git a/src/kits/network/libnetapi/AbstractSocket.cpp b/src/kits/network/libnetapi/AbstractSocket.cpp index 8caf62c659..93a0e66787 100644 --- a/src/kits/network/libnetapi/AbstractSocket.cpp +++ b/src/kits/network/libnetapi/AbstractSocket.cpp @@ -309,7 +309,10 @@ BAbstractSocket::_WaitFor(int flags, bigtime_t timeout) const entry.fd = Socket(); entry.events = flags; - int result = poll(&entry, 1, millis); + int result; + do { + result = poll(&entry, 1, millis); + } while (result == -1 && errno == EINTR); if (result < 0) return errno; if (result == 0) diff --git a/src/kits/network/libnetapi/NetEndpoint.cpp b/src/kits/network/libnetapi/NetEndpoint.cpp index 694d62744a..fa8a529b4a 100644 --- a/src/kits/network/libnetapi/NetEndpoint.cpp +++ b/src/kits/network/libnetapi/NetEndpoint.cpp @@ -490,7 +490,13 @@ BNetEndpoint::IsDataPending(bigtime_t timeout) tv.tv_usec = (timeout % 1000000); } - if (select(fSocket + 1, &fds, NULL, NULL, timeout >= 0 ? &tv : NULL) < 0) { + int status; + do { + status = select(fSocket + 1, &fds, NULL, NULL, + timeout >= 0 ? &tv : NULL); + } while (status == -1 && errno == EINTR); + + if (status < 0) { fStatus = errno; return false; }