mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Another attempt to fix availableData
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5248 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c5d0bc1683
commit
4737b5f498
1 changed files with 1 additions and 17 deletions
|
@ -675,23 +675,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
int count;
|
||||
|
||||
/*
|
||||
* Determine number of bytes readable on descriptor.
|
||||
*/
|
||||
if (ioctl(descriptor, FIONREAD, (char*)&count) < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to use FIONREAD on descriptor - %s",
|
||||
strerror(errno)];
|
||||
}
|
||||
|
||||
if (count > sizeof(buf))
|
||||
{
|
||||
count = sizeof(buf);
|
||||
}
|
||||
if ((len = read(descriptor, buf, count)) > 0)
|
||||
if ((len = read(descriptor, buf, sizeof(buf))) > 0)
|
||||
{
|
||||
[d appendBytes: buf length: len];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue