summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qlocalsocket_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qlocalsocket_unix.cpp')
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp
index a4b51b16d2..77c5028fb3 100644
--- a/src/network/socket/qlocalsocket_unix.cpp
+++ b/src/network/socket/qlocalsocket_unix.cpp
@@ -235,19 +235,11 @@ void QLocalSocket::connectToServer(OpenMode openMode)
}
// create the socket
- if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))) {
+ if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK))) {
d->errorOccurred(UnsupportedSocketOperationError,
QLatin1String("QLocalSocket::connectToServer"));
return;
}
- // set non blocking so we can try to connect and it won't wait
- int flags = fcntl(d->connectingSocket, F_GETFL, 0);
- if (-1 == flags
- || -1 == (fcntl(d->connectingSocket, F_SETFL, flags | O_NONBLOCK))) {
- d->errorOccurred(UnknownSocketError,
- QLatin1String("QLocalSocket::connectToServer"));
- return;
- }
// _q_connectToSocket does the actual connecting
d->connectingName = d->serverName;