diff options
author | Robin Burchell <robin.burchell@jollamobile.com> | 2014-08-03 22:52:19 +0200 |
---|---|---|
committer | Robin Burchell <robin+qt@viroteck.net> | 2014-08-04 05:05:53 +0200 |
commit | 83080e8a7cb7aaa794a9659eeaf34690afe71ddb (patch) | |
tree | a3dae8c3059473e19d093fe17464b577d6767fdb | |
parent | e9782fee8f8772c54aaadc337e101fba0c9709fc (diff) | |
download | qtbase-83080e8a7cb7aaa794a9659eeaf34690afe71ddb.tar.gz |
QNativeSocketEngine: Add debug in createNewSocket.
If this fails, we want to know about it when trying to debug.
Change-Id: I33f05186e93fcd9284a7e7c609d00fe7ac87cd4e
Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r-- | src/network/socket/qnativesocketengine_unix.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 472e0cb98c..871f163a4a 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -154,7 +154,8 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc } if (socket <= 0) { - switch (errno) { + int ecopy = errno; + switch (ecopy) { case EPROTONOSUPPORT: case EAFNOSUPPORT: case EINVAL: @@ -173,9 +174,20 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc break; } +#if defined (QNATIVESOCKETENGINE_DEBUG) + qDebug("QNativeSocketEnginePrivate::createNewSocket(%d, %d) == false (%s)", + socketType, socketProtocol, + strerror(ecopy)); +#endif + return false; } +#if defined (QNATIVESOCKETENGINE_DEBUG) + qDebug("QNativeSocketEnginePrivate::createNewSocket(%d, %d) == true", + socketType, socketProtocol); +#endif + socketDescriptor = socket; return true; } |