mirror of
https://github.com/darlinghq/darling-corefoundation.git
synced 2024-11-26 21:30:22 +00:00
NS{In,Out}putStream: Use CF{Read,Write}StreamCopyError
Not only is this simpler and more convenient, but this is also more correct. With the old behavior, we were always returning an error, even when no error was present (it was returned with code=0).
This commit is contained in:
parent
a18cdf61b4
commit
571cb49a5b
@ -143,8 +143,7 @@
|
||||
|
||||
- (NSError *)streamError
|
||||
{
|
||||
CFStreamError err = CFReadStreamGetError((CFReadStreamRef)self);
|
||||
return [(NSError *)_CFErrorFromStreamError(kCFAllocatorDefault, &err) autorelease];
|
||||
return [CFReadStreamCopyError((CFReadStreamRef)self) autorelease];
|
||||
}
|
||||
|
||||
- (NSStreamStatus)streamStatus
|
||||
|
@ -135,8 +135,7 @@
|
||||
|
||||
- (NSError *)streamError
|
||||
{
|
||||
CFStreamError err = CFWriteStreamGetError((CFWriteStreamRef)self);
|
||||
return [(NSError *)_CFErrorFromStreamError(kCFAllocatorDefault, &err) autorelease];
|
||||
return [CFWriteStreamCopyError((CFWriteStreamRef)self) autorelease];
|
||||
}
|
||||
|
||||
- (NSStreamStatus)streamStatus
|
||||
|
Loading…
Reference in New Issue
Block a user