You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Aaron Bannert <aa...@clove.org> on 2001/12/19 02:23:28 UTC
[PATCH] fix setjmp in perchild
My setjmp man page on Linux says it returns zero or non-zero, so is
this patch more correct?
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);
}
else {
-aaron
Re: [PATCH] fix setjmp in perchild
Posted by Jeff Trawick <tr...@attglobal.net>.
Aaron Bannert <aa...@clove.org> 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 | trawick@attglobal.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...