From: Jeff Trawick Date: Fri, 23 Feb 2001 03:19:29 +0000 (+0000) Subject: Get it to build on FreeBSD by dropping . (It still X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e233ba50271913a58ea1a8f0b77df4feda6cbc56;p=apache Get it to build on FreeBSD by dropping . (It still builds on Linux.) Pass an initialized thread attribute instead of an accidental autodata value to apr_create_signal_thread(). This should avoid a segfault. It seemed to behave a little better for me at this point. Get rid of some warnings. gcc on FreeBSD still warns about a few variables that might be clobbered by longjmp() in worker_thread(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88283 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index 29aa629071..56dfa8d01f 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -103,7 +103,6 @@ #include #include #include -#include /* * Actual definitions of config globals @@ -698,7 +697,7 @@ static void *worker_thread(void *arg) cmsg = apr_palloc(ptrans, sizeof(*cmsg) + sizeof(sd)); cmsg->cmsg_len = sizeof(*cmsg) + sizeof(sd); - msg.msg_control = cmsg; + msg.msg_control = (caddr_t)cmsg; msg.msg_controllen = cmsg->cmsg_len; msg.msg_flags = 0; @@ -842,7 +841,6 @@ static void child_main(int child_num_arg) ap_listen_rec *lr; apr_status_t rv; apr_thread_t *thread; - apr_threadattr_t *thread_attr; my_pid = getpid(); child_num = child_num_arg; @@ -909,8 +907,7 @@ static void child_main(int child_num_arg) apr_threadattr_create(&worker_thread_attr, pchild); apr_threadattr_detach_set(worker_thread_attr); - - apr_create_signal_thread(&thread, thread_attr, check_signal, pchild); + apr_create_signal_thread(&thread, worker_thread_attr, check_signal, pchild); /* We are creating worker threads right now */ for (i=0; i < threads_to_start; i++) { @@ -1373,7 +1370,7 @@ static int pass_request(request_rec *r) memcpy(CMSG_DATA(cmsg), &sfd, sizeof(sfd)); - msg.msg_control = cmsg; + msg.msg_control = (caddr_t)cmsg; msg.msg_controllen = cmsg->cmsg_len; msg.msg_flags=0; diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index 29aa629071..56dfa8d01f 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -103,7 +103,6 @@ #include #include #include -#include /* * Actual definitions of config globals @@ -698,7 +697,7 @@ static void *worker_thread(void *arg) cmsg = apr_palloc(ptrans, sizeof(*cmsg) + sizeof(sd)); cmsg->cmsg_len = sizeof(*cmsg) + sizeof(sd); - msg.msg_control = cmsg; + msg.msg_control = (caddr_t)cmsg; msg.msg_controllen = cmsg->cmsg_len; msg.msg_flags = 0; @@ -842,7 +841,6 @@ static void child_main(int child_num_arg) ap_listen_rec *lr; apr_status_t rv; apr_thread_t *thread; - apr_threadattr_t *thread_attr; my_pid = getpid(); child_num = child_num_arg; @@ -909,8 +907,7 @@ static void child_main(int child_num_arg) apr_threadattr_create(&worker_thread_attr, pchild); apr_threadattr_detach_set(worker_thread_attr); - - apr_create_signal_thread(&thread, thread_attr, check_signal, pchild); + apr_create_signal_thread(&thread, worker_thread_attr, check_signal, pchild); /* We are creating worker threads right now */ for (i=0; i < threads_to_start; i++) { @@ -1373,7 +1370,7 @@ static int pass_request(request_rec *r) memcpy(CMSG_DATA(cmsg), &sfd, sizeof(sfd)); - msg.msg_control = cmsg; + msg.msg_control = (caddr_t)cmsg; msg.msg_controllen = cmsg->cmsg_len; msg.msg_flags=0;