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:
rfm 2007-01-28 07:15:27 +00:00
parent f6b873822c
commit 7ccd13517b
3 changed files with 20 additions and 1 deletions

View file

@ -360,6 +360,7 @@ static void setNonblocking(int fd)
if (fd < 0)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
_loopID = (void*)(intptr_t)fd;
@ -472,6 +473,7 @@ static void setNonblocking(int fd)
return;
}
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
}
@ -756,9 +758,10 @@ static void setNonblocking(int fd)
else
flag = flag | O_TRUNC;
fd = open([_path fileSystemRepresentation], flag, mode);
if (fd< 0)
if (fd < 0)
{ // make an error
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
_loopID = (void*)(intptr_t)fd;
@ -917,6 +920,7 @@ static void setNonblocking(int fd)
return;
}
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
}
@ -1450,6 +1454,7 @@ static void setNonblocking(int fd)
if (bindReturn < 0 || listenReturn < 0)
{
[self _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
return;
}
setNonblocking((intptr_t)_loopID);