[PATCH] Fix ETIME handling for Solaris event ports

Nathan Huff nhuff at acm.org
Fri Feb 5 03:43:20 UTC 2016


I actually prefer the code flow from the original patch.  At least to me it
makes the code match the logic of the problem better, but that might just
be me.

I didn't address this in my earlier patches, but while we are here this
test seems superfluous.

port_errno == ETIME && tvalp

Is it possible to get ETIME without tvalp being set? If tvalp is NULL we
should block indefinitely.

On Thu, Feb 4, 2016 at 4:32 PM, Stefan Metzmacher <metze at samba.org> wrote:

> Hi Jeremy,
>
> can we minimize the diff please?
>
> Something this would be nicer,
> while replacing "some useful comment" with some comments
> which explain what you've discussed in this thread.
>
>
> --- a/lib/tevent/tevent_port.c
> +++ b/lib/tevent/tevent_port.c
> @@ -497,9 +497,18 @@ static int port_event_loop(struct
> port_event_context *port_ev, struct timeval *t
>         }
>
>         if (ret == -1 && port_errno == ETIME && tvalp) {
> -               /* we don't care about a possible delay here */
> -               tevent_common_loop_timer_delay(ev);
> -               return 0;
> +               /*
> +                * some useful comment
> +                */
> +               if (nget == 0) {
> +                       /* we don't care about a possible delay here */
> +                       tevent_common_loop_timer_delay(ev);
> +                       return 0;
> +               }
> +               /*
> +                * some useful comment
> +                */
> +               errno = 0;
> +               ret = 0;
>         }
>
>         if (ret == -1) {
>
> metze
>
>


More information about the samba-technical mailing list