[systemd-devel] [PATCH 2/3] systemctl: more cleanup
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Fri May 16 19:22:02 PDT 2014
On Fri, May 16, 2014 at 11:53:24PM +0200, Thomas H.P. Andersen wrote:
> From: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
>
> This is followup on 05cae7f3431446236139434ee58a6275f3cb31e8
>
> I think the intention was to use the newly introduced 'path'
> variable in the inner loop instead of p.
Thanks for catching this. Looks good.
Zbyszek
> src/systemctl/systemctl.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
> index 2fa8ecc..6e98c05 100644
> --- a/src/systemctl/systemctl.c
> +++ b/src/systemctl/systemctl.c
> @@ -5030,16 +5030,16 @@ static int enable_sysv_units(const char *verb, char **args) {
> _cleanup_free_ char *path = NULL;
>
> if (!isempty(arg_root))
> - asprintf(&p, "%s/%s/%s", arg_root, *k, name);
> + asprintf(&path, "%s/%s/%s", arg_root, *k, name);
> else
> - asprintf(&p, "%s/%s", *k, name);
> + asprintf(&path, "%s/%s", *k, name);
>
> - if (!p) {
> + if (!path) {
> r = log_oom();
> goto finish;
> }
>
> - found_native = access(p, F_OK) >= 0;
> + found_native = access(path, F_OK) >= 0;
> if (found_native)
> break;
> }
> --
> 1.9.0
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
More information about the systemd-devel
mailing list