On Fri, Mar 28, 2014 at 7:43 PM, Hristo Venev <hri...@venev.name> wrote:
> On Fri, 2014-03-28 at 19:02 +0100, Kay Sievers wrote:
>> On Fri, Mar 28, 2014 at 6:38 PM, Hristo Venev <hri...@venev.name> wrote:
>> > They are temporary and should not clutter the configuration directory.
>> > ---
>> >  src/core/unit.c | 32 +++++++++++++++-----------------
>> >  1 file changed, 15 insertions(+), 17 deletions(-)
>> >
>> > diff --git a/src/core/unit.c b/src/core/unit.c
>>
>> > +                        c = strappend(getenv("XDG_RUNTIME_DIR"), 
>> > "/systemd/user");
>>
>> Nesting function calls without error checking should be avoided for
>> systemd code.
>>
>> Kay
>
> This is executed only if the manager is running as user. In case
> XDG_RUNTIME_DIR isn't set, systemd would fail to start.

It should still go into its own variable if you want to skip the
check. We should not rely on the behaviour of external functions like
that.

Even when it is not likely to ever fail, or never even to be called as
PID1, it's still the coding pattern that matters, and PID1 code has
stricter rules than usual user code.

Kay
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to