[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Fix compilation error in util/vircgroup.c



On Tue, Apr 16, 2013 at 07:11:20AM -0400, Stefan Berger wrote:
> Fix the error
> 
> util/vircgroup.c: In function 'virCgroupNewDomainPartition':
> util/vircgroup.c:1299:11: error: declaration of 'dirname' shadows a
> global declaration [-Werror=shadow]
> 
> 
> Signed-off-by: Stefan Berger <stefanb linux vnet ibm com>
> 
> ---
>  src/util/vircgroup.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Index: libvirt-acl/src/util/vircgroup.c
> ===================================================================
> --- libvirt-acl.orig/src/util/vircgroup.c
> +++ libvirt-acl/src/util/vircgroup.c
> @@ -1296,13 +1296,13 @@ int virCgroupNewDomainPartition(virCgrou
>                                  virCgroupPtr *group)
>  {
>      int rc;
> -    char *dirname = NULL;
> +    char *directoryname = NULL;

This is a bit too verbose. Just call it 'grpname' instead.

> 
> -    if (virAsprintf(&dirname, "%s.%s.libvirt",
> +    if (virAsprintf(&directoryname, "%s.%s.libvirt",
>                      name, driver) < 0)
>          return -ENOMEM;
> 
> -    rc = virCgroupNew(dirname, partition, -1, group);
> +    rc = virCgroupNew(directoryname, partition, -1, group);
> 
>      if (rc == 0) {
>          /*
> @@ -1322,7 +1322,7 @@ int virCgroupNewDomainPartition(virCgrou
>          }
>      }
> 
> -    VIR_FREE(dirname);
> +    VIR_FREE(directoryname);
>      return rc;
>  }
>  #else
> 


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]