]> granicus.if.org Git - apache/commitdiff
Get it to build on FreeBSD by dropping <stropt.h>. (It still
authorJeff Trawick <trawick@apache.org>
Fri, 23 Feb 2001 03:19:29 +0000 (03:19 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 23 Feb 2001 03:19:29 +0000 (03:19 +0000)
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

server/mpm/experimental/perchild/perchild.c
server/mpm/perchild/perchild.c

index 29aa629071bd0dcd3edfffb86b2499119ea6231c..56dfa8d01f4a33d65ac9abde584dd6282155c20e 100644 (file)
 #include <sys/stat.h>
 #include <sys/un.h>
 #include <setjmp.h>
-#include <stropts.h>
 
 /*
  * 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;
 
index 29aa629071bd0dcd3edfffb86b2499119ea6231c..56dfa8d01f4a33d65ac9abde584dd6282155c20e 100644 (file)
 #include <sys/stat.h>
 #include <sys/un.h>
 #include <setjmp.h>
-#include <stropts.h>
 
 /*
  * 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;