summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-03-25 16:08:30 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-25 16:08:30 (GMT)
commit5dcf29ec09bd9741bb48449a07831987a75bf42a (patch)
treecd0c3ecdc33bb93075e3a7d9b2593382e2768948 /src/network
parent9b40f0275043566a6e1f1471e1f608dd66929b81 (diff)
parent2ab5d8db650118312bfe9b1e60c4ac60229b229f (diff)
downloadQt-5dcf29ec09bd9741bb48449a07831987a75bf42a.zip
Qt-5dcf29ec09bd9741bb48449a07831987a75bf42a.tar.gz
Qt-5dcf29ec09bd9741bb48449a07831987a75bf42a.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 534f7ec..73f6f84 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -884,15 +884,15 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool selectForRead) co
if (timeout > 0) {
// recalculate the timeout
- timeout -= timer.elapsed();
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
-
- if (timeout < 0) {
+ int t = timeout - timer.elapsed();
+ if (t < 0) {
// oops, timeout turned negative?
retval = -1;
break;
}
+
+ tv.tv_sec = t / 1000;
+ tv.tv_usec = (t % 1000) * 1000;
}
} while (true);
@@ -927,15 +927,15 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c
if (timeout > 0) {
// recalculate the timeout
- timeout -= timer.elapsed();
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
-
- if (timeout < 0) {
+ int t = timeout - timer.elapsed();
+ if (t < 0) {
// oops, timeout turned negative?
ret = -1;
break;
}
+
+ tv.tv_sec = t / 1000;
+ tv.tv_usec = (t % 1000) * 1000;
}
} while (true);
if (ret <= 0)