apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: svn commit: r1736521 - in /apr/apr/branches/1.6.x: ./ include/ include/arch/unix/ poll/unix/ test/
Date Tue, 09 Aug 2016 21:31:17 GMT
Am 25.03.2016 um 02:19 schrieb minfrin@apache.org:
> Author: minfrin
> Date: Fri Mar 25 01:19:34 2016
> New Revision: 1736521
>
> URL: http://svn.apache.org/viewvc?rev=1736521&view=rev
> Log:
> Add apr_pollcb_wakeup(), with similar behavior to
> apr_pollset_wakeup(). Add apr_pollcb_method_name(), with similar
> behavior to apr_pollset_method_name().
>

...

> Modified: apr/apr/branches/1.6.x/poll/unix/port.c
> URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/poll/unix/port.c?rev=1736521&r1=1736520&r2=1736521&view=diff
> ==============================================================================
> --- apr/apr/branches/1.6.x/poll/unix/port.c (original)
> +++ apr/apr/branches/1.6.x/poll/unix/port.c Fri Mar 25 01:19:34 2016
> @@ -413,7 +413,7 @@ static apr_status_t impl_pollset_poll(ap
>              if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
>                  fp.desc_type == APR_POLL_FILE &&
>                  fp.desc.f == pollset->wakeup_pipe[0]) {
> -                apr_pollset_drain_wakeup_pipe(pollset);
> +                apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
>                  rv = APR_EINTR;
>              }
>              else {
> @@ -466,9 +466,8 @@ static apr_pollset_provider_t impl = {
>
>  apr_pollset_provider_t *apr_pollset_provider_port = &impl;
>
> -static apr_status_t cb_cleanup(void *p_)
> +static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb)
>  {
> -    apr_pollcb_t *pollcb = (apr_pollcb_t *) p_;
>      close(pollcb->fd);
>      return APR_SUCCESS;
>  }
> @@ -505,7 +504,6 @@ static apr_status_t impl_pollcb_create(a
>      }
>
>      pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t));
> -    apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null);
>
>      return APR_SUCCESS;
>  }
> @@ -558,16 +556,25 @@ static apr_status_t impl_pollcb_poll(apr
>                                       apr_pollcb_cb_t func,
>                                       void *baton)
>  {
> -    apr_pollfd_t *pollfd;
>      apr_status_t rv;
> -    unsigned int i, nget = 1;
> +    unsigned int nget = 1;
>
>      rv = call_port_getn(pollcb->fd, pollcb->pollset.port, pollcb->nalloc,
>                          &nget, timeout);
>
>      if (nget) {
> +        unsigned int i;
> +
>          for (i = 0; i < nget; i++) {
> -            pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user);
> +            apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user);
> +
> +            if ((pollfd->flags & APR_POLLSET_WAKEABLE) &&
> +                pollfd->desc_type == APR_POLL_FILE &&
> +                pollfd->desc.f == pollcb->wakeup_pipe[0]) {
> +                apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe);
> +                return APR_EINTR;
> +            }
> +
>              pollfd->rtnevents = get_revent(pollcb->pollset.port[i].portev_events);
>
>              rv = func(baton, pollfd);
> @@ -586,6 +593,7 @@ static apr_pollcb_provider_t impl_cb = {
>      impl_pollcb_add,
>      impl_pollcb_remove,
>      impl_pollcb_poll,
> +    impl_pollcb_cleanup,
>      "port"
>  };

I get a compilation error (ggc on Solaris):

.../poll/unix/port.c: In function 'impl_pollcb_poll':
.../poll/unix/port.c:571:24: error: 'apr_pollfd_t' has no member named 
'flags'
              if ((pollfd->flags & APR_POLLSET_WAKEABLE) &&
                         ^

Maybe the following patch is appropriate?

--- poll/unix/port.c (revision 1755647)
+++ poll/unix/port.c (working copy)
@@ -568,7 +568,7 @@
          for (i = 0; i < nget; i++) {
              apr_pollfd_t *pollfd = (apr_pollfd_t 
*)(pollcb->pollset.port[i].portev_user);

-            if ((pollfd->flags & APR_POLLSET_WAKEABLE) &&
+            if ((pollcb->flags & APR_POLLSET_WAKEABLE) &&
                  pollfd->desc_type == APR_POLL_FILE &&
                  pollfd->desc.f == pollcb->wakeup_pipe[0]) {
                  apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe);

At least it builds and "make check" runs fine.

Regards,

Rainer

Mime
View raw message