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:
Richard Frith-MacDonald 1999-11-21 22:25:53 +00:00
parent c5d0bc1683
commit 4737b5f498

View file

@ -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];
}