mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
a1e4758abf
commit
7ea54068cf
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
|
else
|
||||||
{
|
{
|
||||||
int count;
|
if ((len = read(descriptor, buf, sizeof(buf))) > 0)
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)
|
|
||||||
{
|
{
|
||||||
[d appendBytes: buf length: len];
|
[d appendBytes: buf length: len];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue