Conditions always true in tevent_standard.c

Ralph Boehme slow at samba.org
Mon Jul 4 17:17:31 UTC 2016


On Mon, Jul 04, 2016 at 07:17:20PM +0300, Nikolai Kondrashov wrote:
> On 06/30/2016 10:24 PM, Jeremy Allison wrote:
> >On Wed, Jun 29, 2016 at 03:43:34PM +0300, Nikolai Kondrashov wrote:
> >>Please find the patch attached. I also tried to rearrange the conditions to
> >>make the code easier to understand.
> >
> >I like the comment. I don't like the rearrangement of conditions.
> >
> >In Samba we prefer simplified if statement that cause early exit,
> >rather than complex if conditions. Unfortunately your patch makes
> >the if conditions complex.
> >
> >I'd prefer something that just adds the comment before the
> >if == NULL check.
> 
> I understand, and this sounds like a good convention in general.
> However, I think it makes these small functions and conditions harder to read.
> Perhaps an exception for small functions would be in order.
> 
> Regardless, it's your code and you decide, so here is an updated patch :)

I know I'm late in the game and didn't check all the nitty-gritty
details, but I'm wondering if it's a good idea to misuse the functions
pointers as state variable. Maybe adding something like bool
epoll_panicked is a better idea?

Cheerio!
-slow



More information about the samba-technical mailing list