From e0c75e80bc606c5230fdffb6f79281b6b4531a7e Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 12 Dec 2002 01:15:19 +0000 Subject: [PATCH] the portable success test for ioctl is if it returns an int greater than or equal to zero --- src/ca/tcpiiu.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index c8a6e760d..0de386ffd 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -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