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>
This commit is contained in:
Robin Burchell 2014-08-03 22:52:19 +02:00 committed by Robin Burchell
parent e9782fee8f
commit 83080e8a7c

View File

@ -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;
}