diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-21 19:03:56 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-03-22 10:15:39 (GMT) |
commit | 32a43ac64aee529c55af77edbbe34c54cb8f5e52 (patch) | |
tree | 0e27609c830d9666976f01cca959e63680d73048 /src/network | |
parent | 919e282ff62171654dd60875fe1c058f36a14584 (diff) | |
download | Qt-32a43ac64aee529c55af77edbbe34c54cb8f5e52.zip Qt-32a43ac64aee529c55af77edbbe34c54cb8f5e52.tar.gz Qt-32a43ac64aee529c55af77edbbe34c54cb8f5e52.tar.bz2 |
Report correct error from QSymbianSocketEngine::nativeSelect
Sometimes the error is in the return code from the ioctl, other times
it is in the select last error getopt. Treat both error sources the
same way and call setError. Return code has higher priority.
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qsymbiansocketengine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp index 07b2e5a..58e8d9f 100644 --- a/src/network/socket/qsymbiansocketengine.cpp +++ b/src/network/socket/qsymbiansocketengine.cpp @@ -1137,14 +1137,14 @@ int QSymbianSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool #ifdef QNATIVESOCKETENGINE_DEBUG qDebug() << "QSymbianSocketEnginePrivate::nativeSelect: select status" << selectStat.Int() << (int)selectFlags(); #endif - if (selectStat != KErrNone) - return selectStat.Int(); - if (selectFlags() & KSockSelectExcept) { - TInt err; + TInt err = selectStat.Int(); + if (!err && (selectFlags() & KSockSelectExcept)) { nativeSocket.GetOpt(KSOSelectLastError, KSOLSocket, err); #ifdef QNATIVESOCKETENGINE_DEBUG qDebug() << "QSymbianSocketEnginePrivate::nativeSelect: select last error" << err; #endif + } + if (err) { //TODO: avoidable cast? //set the error here, because read won't always return the same error again as select. const_cast<QSymbianSocketEnginePrivate*>(this)->setError(err); |