File qnativesocketengine-select.diff of Package libQtWebKit-devel
--- src/network/socket/qnativesocketengine_unix.cpp
+++ src/network/socket/qnativesocketengine_unix.cpp
@@ -838,10 +838,15 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool selectForRead) co
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
- if (selectForRead)
- return select(socketDescriptor + 1, &fds, 0, 0, timeout < 0 ? 0 : &tv);
- else
- return select(socketDescriptor + 1, 0, &fds, 0, timeout < 0 ? 0 : &tv);
+ int retval;
+ do {
+ if (selectForRead)
+ retval = select(socketDescriptor + 1, &fds, 0, 0, timeout < 0 ? 0 : &tv);
+ else
+ retval = select(socketDescriptor + 1, 0, &fds, 0, timeout < 0 ? 0 : &tv);
+ } while (retval == -1 && errno == EINTR);
+
+ return retval;
}
int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool checkWrite,
@@ -861,7 +866,10 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
- int ret = select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv);
+ int ret;
+ do {
+ ret = select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv);
+ } while (ret == -1 && errno == EINTR);
if (ret <= 0)
return ret;