the portable success test for ioctl is if it returns an int greater than or equal to zero

This commit is contained in:
Jeff Hill
2002-12-12 01:15:19 +00:00
parent a612619458
commit e0c75e80bc

View File

@@ -1428,11 +1428,10 @@ bool tcpiiu::bytesArePendingInOS () const
osiSockIoctl_t bytesPending = 0; /* shut up purifys yapping */
int status = socket_ioctl ( this->sock, // X aCC 392
FIONREAD, & bytesPending );
if ( status ) {
return false;
}
if ( bytesPending > 0 ) {
return true;
if ( status >= 0 ) {
if ( bytesPending > 0 ) {
return true;
}
}
return false;
#endif