[systemd-devel] [PATCH 1/2] Moving null check for strv_path_canonicalize inside function.

Lennart Poettering lennart at poettering.net
Mon Sep 20 15:39:50 PDT 2010


On Thu, 16.09.10 23:30, Luis Felipe Strano Moraes (luis.strano at gmail.com) wrote:

>          strv_uniq(p->unit_path);
>          strv_uniq(p->sysvinit_path);
> diff --git a/src/util.c b/src/util.c
> index bdc194e..e9ff11b 100644
> --- a/src/util.c
> +++ b/src/util.c
> @@ -986,7 +986,9 @@ char **strv_path_canonicalize(char **l) {
>          unsigned k = 0;
>          bool enomem = false;
>  
> -        if (strv_isempty(l))
> +        if (!l)
> +                return true;

true? it's a char** return value!

> +        else if (strv_isempty(l))
>                  return l;

Note that strv_isempty() already considers l == NULL as an empty strv.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list