Send event if an error occurs in -open

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24422 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-01-28 07:15:27 +00:00
parent 094b9191d3
commit 39d5aec7e1
3 changed files with 20 additions and 1 deletions

View file

@ -326,6 +326,7 @@ static void setNonblocking(SOCKET fd)
if (h == INVALID_HANDLE_VALUE)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
[self _setLoopID: (void*)h];
@ -765,6 +766,7 @@ static void setNonblocking(SOCKET fd)
&& WSAGetLastError() != WSAEWOULDBLOCK)
{// make an error
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
// waiting on writable, as an indication of opened
@ -1077,6 +1079,7 @@ static void setNonblocking(SOCKET fd)
if (h == INVALID_HANDLE_VALUE)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
else if (_shouldAppend == NO)
@ -1084,6 +1087,7 @@ static void setNonblocking(SOCKET fd)
if (SetEndOfFile(h) == 0) // Truncate to current file pointer (0)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
}
}
[self _setLoopID: (void*)h];
@ -1539,6 +1543,7 @@ static void setNonblocking(SOCKET fd)
&& WSAGetLastError() != WSAEWOULDBLOCK)
{// make an error
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
// waiting on writable, as an indication of opened
@ -2231,6 +2236,7 @@ done:
if (bindReturn < 0 || listenReturn < 0)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
setNonblocking(_sock);
@ -2444,6 +2450,7 @@ done:
if (handle == INVALID_HANDLE_VALUE)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
@ -2466,6 +2473,7 @@ done:
else if (errno != ERROR_IO_PENDING)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
}