Aaron Bannert <[EMAIL PROTECTED]> writes:

> My setjmp man page on Linux says it returns zero or non-zero, so is
> this patch more correct?

My Linux setjmp() man page is pretty poor w.r.t. the return value

> Index: server/mpm/perchild/perchild.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
> retrieving revision 1.93
> diff -u -u -r1.93 perchild.c
> --- server/mpm/perchild/perchild.c    2001/12/19 01:22:03     1.93
> +++ server/mpm/perchild/perchild.c    2001/12/19 01:22:21
> @@ -807,7 +807,7 @@
>                  thread_socket_table[thread_num] = dp;
>                  apr_os_sock_put(&csd, &child_info_table[child_num].sd, ptrans);
>              }
> -            if (setjmp(jmpbuffer) != 1) {
> +            if (!setjmp(jmpbuffer)) {
>                  process_socket(ptrans, csd, conn_id);
>              }


setjmp() returns

0                 initial setup
1                 if 2nd parameter to longjmp() is 0 or 1
n                 if 2nd parameter to longjmp() is n

Since perchild passes 1 as second parameter to longjmp(), the original
"if setjmp() != 1" says "if I didn't longjmp() here".

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Reply via email to