httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@ibm.net>
Subject Re: cvs commit: apache-2.0/src/modules/mpm/dexter dexter.c
Date Thu, 22 Jun 2000 19:18:51 GMT
> From: rbb@locus.apache.org
> Date: 22 Jun 2000 19:06:08 -0000
> 
>   Index: dexter.c
>   ===================================================================
>   RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v

...

>            while (!workers_may_exit) {
>   -            srv = poll(listenfds, num_listenfds + 1, -1);
>   +            ap_int16_t event;
>   +            srv = ap_poll(pollset, &n, -1);
>    
>   -            if (srv < 0) {
>   -                if (errno == EINTR) {
>   +            if (srv != APR_SUCCESS) {
>   +                if (errno == APR_EINTR) {

Shouldn't we be checking srv instead of errno?  Should we
cannonicalize it before comparing with APR_EINTR?

>   @@ -787,15 +796,10 @@
>        requests_this_child = max_requests_per_child;
>        
>        /* Set up the pollfd array */
>   -    listenfds = ap_palloc(pchild, sizeof(struct pollfd) * (num_listenfds + 1));
>   -    listenfds[0].fd = pipe_of_death[0];
>   -    listenfds[0].events = POLLIN;
>   -    listenfds[0].revents = 0;
>   -    for (lr = ap_listeners, i = 1; i <= num_listenfds; lr = lr->next, ++i) {
>   -        ap_get_os_sock(&listenfds[i].fd, lr->sd);
>   -        listenfds[i].events = POLLIN; /* should we add POLLPRI ?*/
>   -        listenfds[i].revents = 0;
>   -    }
>   +    listenfds = ap_palloc(pchild, sizeof(*listenfds) * (num_listenfds + 1));
>   +    ap_put_os_sock(&listenfds[0], &pipe_of_death[0], pchild);

If we don't set the storage pointed to by listenfds to zero (via
ap_pcalloc()), won't ap_put_os_sock() assume that listenfds[n] is a pointer to
existing storage to be used for the ap_sock_t, rather than a place to
store the pointer to new storage to be used for the ap_sock_t?
Instead, listenfds[0] is uninitialized.

>   +    for (lr = ap_listeners, i = 1; i <= num_listenfds; lr = lr->next, ++i)
>   +        listenfds[i]=lr->sd;

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message