Commit e233ba50 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

Get it to build on FreeBSD by dropping <stropt.h>. (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
parent 8fef8a0b
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@
#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;

+3 −6
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@
#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;