mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1162524: Fix error handling |UnixSocketWatcher::Connect|, r=kmachulis
With this patch, it's not an error if the connection operations stalls on a non-blocking socket; so don't return an error code. The patch also makes |connect| restart if it was aborted by a signal.
This commit is contained in:
parent
54a48be6eb
commit
3b73c6d279
@ -29,14 +29,14 @@ UnixSocketWatcher::Connect(const struct sockaddr* aAddr, socklen_t aAddrLen)
|
||||
MOZ_ASSERT(IsOpen());
|
||||
MOZ_ASSERT(aAddr || !aAddrLen);
|
||||
|
||||
if (connect(GetFd(), aAddr, aAddrLen) < 0) {
|
||||
if (TEMP_FAILURE_RETRY(connect(GetFd(), aAddr, aAddrLen) < 0)) {
|
||||
if (errno == EINPROGRESS) {
|
||||
mConnectionStatus = SOCKET_IS_CONNECTING;
|
||||
// Set up a write watch to receive the connect signal
|
||||
AddWatchers(WRITE_WATCHER, false);
|
||||
} else {
|
||||
OnError("connect", errno);
|
||||
return NS_OK;
|
||||
}
|
||||
OnError("connect", errno);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user