summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-03-10 18:20:53 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-03-11 11:22:11 (GMT)
commita2c9031817a7faaab62b15b8976a1c8664e108d6 (patch)
tree578151c691b04186eaa9d7209dbbd98ae54e2365
parent99baeb5b6b2c6d0b2724709ae8caa789e5ad5895 (diff)
downloadQt-a2c9031817a7faaab62b15b8976a1c8664e108d6.zip
Qt-a2c9031817a7faaab62b15b8976a1c8664e108d6.tar.gz
Qt-a2c9031817a7faaab62b15b8976a1c8664e108d6.tar.bz2
QSymbianSocketEngine - return expected error code from bind
In the unix socket engine, EADDRNOTAVAIL is returned by the native call when attempting to bind to a non existant interface. On symbian, the generic KErrNotFound is returned. Specifically for bind() convert KErrNotFound to the expected error code QAbstractSocket::SocketAddressNotAvailableError which is relied on by autotest (and possibly but unlikely, existing applications) Reviewed-by: Markus Goetz
-rw-r--r--src/network/socket/qsymbiansocketengine.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp
index ed7962c..491b515 100644
--- a/src/network/socket/qsymbiansocketengine.cpp
+++ b/src/network/socket/qsymbiansocketengine.cpp
@@ -669,7 +669,15 @@ bool QSymbianSocketEngine::bind(const QHostAddress &address, quint16 port)
#endif
if (err) {
- d->setError(err);
+ switch (err) {
+ case KErrNotFound:
+ // the specified interface was not found - use the error code expected
+ d->setError(QAbstractSocket::SocketAddressNotAvailableError, QSymbianSocketEnginePrivate::AddressNotAvailableErrorString);
+ break;
+ default:
+ d->setError(err);
+ break;
+ }
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QSymbianSocketEngine::bind(%s, %i) == false (%s)",