[systemd-devel] [PATCH] cg_path_get_user_unit(): Did not correctly parse user-unit templates.

Luke Shumaker lukeshu at sbcglobal.net
Tue Feb 3 17:05:11 PST 2015


At Wed, 4 Feb 2015 01:52:36 +0100,
Lennart Poettering wrote:
> > +        /* Skip the session scope or user manager... */
> > +        (t = skip_session(e)) || (t = skip_user_manager(e));
> 
> Hmpf, I really don't like this ()||() magic I must say.
> 
> Any chance you can rework this to just use normal
> 
> t = skip_session(e);
> if (!t)
>         t = skip_user_manager(...)
> 
> THis is really an excercise in making code easily readable, not an
> excercsie to show superior C skills ;-)

Sure.  I thought the || version was easier to read; that it showed the
intent better.  Though it may be that it's similar to a Ruby idiom,
and I've been working with some Ruby recently.

--
Happy hacking,
~ Luke Shumaker


More information about the systemd-devel mailing list