On Thu, 27.06.13 18:30, Holger Hans Peter Freyther (hol...@freyther.de) wrote:

> From: Holger Hans Peter Freyther <hol...@moiji-mobile.com>
> 
> Allow to cache the cg_get_root_path and introduce a new method
> cg_pid_get_path_shifted_with_root that can use the cached version
> instead of allocating a new string.

Sorry for the delay in reviewing.

THe general approach of caching the result of cg_get_root_path() is a
good one, but I am not fond of placing this in a static variable. We try
to avoid that where possible, especially if we have some kind of context
object around anyway where we could place this.

> +        if (!cg_root)
> +                return -1;

We use negative "errno"-style errors everywhere for indicating errors,
not -1. i.e. please use "return -EINVAL" or suchlike, but not literal
numeric constants.

Thanks,

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to