tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: svn commit: r603400 - /tomcat/connectors/trunk/jk/native/common/jk_connect.c
Date Wed, 12 Dec 2007 06:34:09 GMT
rjung@apache.org wrote:
> Log:
> Add function description comments and
> switch return values of jk_is_socket_connected()
> from 0/1 to JK_FALSE/JK_TRUE.
> 
> -            return nr == 0 ? 0 : 1;
> +            return nr == JK_FALSE ? JK_FALSE : JK_TRUE;


>          int nr;
>          if (ioctl(sock, FIONREAD, (void*)&nr) == 0) {
> -            return nr == 0 ? 0 : 1;
> +            return nr == JK_FALSE ? JK_FALSE : JK_TRUE;
>          }

This should actually be:
return nr == 0 ? JK_FALSE : JK_TRUE;
if you wish to return JK_TRUE/JK_FALSE

We are testing for 0 not for JK_FALSE (which happens to be zero)
that can be defined to anything.

Regards,
Mladen


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message