summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-12-24 17:01:52 -0200
committerThiago Macieira <thiago.macieira@intel.com>2015-02-15 01:26:28 +0000
commitd866f6e8861647c45f438bc5b21905dacee41f8e (patch)
treefda6c73cc1164ff2cac9bccc02657cf2990347ff /src/network/socket/qnativesocketengine.cpp
parent0fa7374f1dc433b6b8955cb14dabb22c10f50854 (diff)
Save two system calls for setting a socket non-blocking on Linux
Linux's socket(2) system call can take SOCK_NONBLOCK and let us avoid the extra two fcntl(2) to change the setting after it's created. Change-Id: Ie0d7a2d51acc21acd850cbee6d0f76e27b1ae859 Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/socket/qnativesocketengine.cpp')
-rw-r--r--src/network/socket/qnativesocketengine.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index e7113c8c5e..63f50632d2 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -357,14 +357,6 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb
return false;
}
- // Make the socket nonblocking.
- if (!setOption(NonBlockingSocketOption, 1)) {
- d->setError(QAbstractSocket::UnsupportedSocketOperationError,
- QNativeSocketEnginePrivate::NonBlockingInitFailedErrorString);
- close();
- return false;
- }
-
// Set the broadcasting flag if it's a UDP socket.
if (socketType == QAbstractSocket::UdpSocket
&& !setOption(BroadcastSocketOption, 1)) {