You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GOMEZ Henri <hg...@slib.fr> on 2001/02/27 18:18:00 UTC

RE: cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_connec t.c

   
>  @@ -108,7 +108,7 @@
>       jk_log(l, JK_LOG_DEBUG, "Into jk_open_socket\n");
>   
>       sock = socket(AF_INET, SOCK_STREAM, 0);
>  -    if(sock > 0) {
>  +    if(sock > -1) {
>           int ret;
>           /* Tries to connect to JServ (continues trying 
>while error is EINTR) */
>           do {
>  

Better to check that sock != -1.

man socket indicate that only -1 

>>>>>>><

RETURN VALUES
       A -1 is returned if an error occurs, otherwise the return value is a
descriptor referencing the socket.

ERRORS
       EPROTONOSUPPORT The protocol type or the specified protocol is not
supported within this domain.
       EMFILE  The per-process descriptor table is full.
       ENFILE  The system file table is full.
       EACCES  Permission to create a socket of the specified type and/or
protocol is denied.
       ENOBUFS Insufficient buffer space is available.  The socket cannot be
created until sufficient resources are freed.


>  @@ -108,7 +108,7 @@
>       jk_log(l, JK_LOG_DEBUG, "Into jk_open_socket\n");
>   
>       sock = socket(AF_INET, SOCK_STREAM, 0);
>  -    if(sock > -1) {
>  +    if(sock != -1) {
>           int ret;
>           /* Tries to connect to JServ (continues trying 
>while error is EINTR) */
>           do {
>