[lxc-devel] [PATCH] lxc_info: Fix -H with -c

Serge Hallyn serge.hallyn at ubuntu.com
Fri Jan 31 10:18:14 UTC 2014


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/lxc_info.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c
> index 7915c0e..4243cf3 100644
> --- a/src/lxc/lxc_info.c
> +++ b/src/lxc/lxc_info.c
> @@ -338,11 +338,17 @@ static int print_info(const char *name, const char *lxcpath)
>  			if (c->get_config_item(c, key[i], val, len + 1) != len) {
>  				fprintf(stderr, "unable to read %s from configuration\n", key[i]);
>  			} else {
> -				printf("%s = %s\n", key[i], val);
> +				if (!humanize && keys == 1)
> +					printf("%s\n", val);
> +				else
> +					printf("%s = %s\n", key[i], val);
>  			}
>  			free(val);
>  		} else if (len == 0) {
> -			printf("%s =\n", key[i]);
> +			if (!humanize && keys == 1)
> +				printf("\n");
> +			else
> +				printf("%s =\n", key[i]);
>  		} else {
>  			fprintf(stderr, "%s invalid\n", key[i]);
>  		}
> -- 
> 1.9.rc1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list