Re: [PATCH 2/4] virGetGroupList: Refactor and fix callers

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

 



On Wed, May 22, 2024 at 18:00:17 +0200, Peter Krempa wrote:
> Use contemporary style for declarations and automatic memory clearing
> for a helper string.
> 
> Since the function can't fail any more, remove any mention of returning
> errno and remove error checks from all callers.
> 
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  src/lxc/lxc_container.c         |  4 ++--
>  src/security/security_dac.c     |  7 +------
>  src/util/vircommand.c           |  3 +--
>  src/util/virfile.c              |  8 --------
>  src/util/virutil.c              | 16 ++++++++--------
>  tests/commandtest.c             |  5 ++---
>  tools/virt-login-shell-helper.c |  3 +--
>  7 files changed, 15 insertions(+), 31 deletions(-)
> 
> diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
> index 652697890f..7e460544fb 100644
> --- a/src/lxc/lxc_container.c
> +++ b/src/lxc/lxc_container.c
> @@ -2059,8 +2059,8 @@ static int lxcContainerChild(void *data)
>      /* TODO is it safe to call it here or should this call be moved in
>       * front of the clone() as otherwise there might be a risk for a
>       * deadlock */
> -    if ((ngroups = virGetGroupList(virCommandGetUID(cmd), virCommandGetGID(cmd),
> -                                   &groups)) < 0)
> +    ngroups = virGetGroupList(virCommandGetUID(cmd), virCommandGetGID(cmd),
> +                              &groups);
>          goto cleanup;

Looks like leftover goto here.

> 
>      ret = 0;
...

Reviewed-by: Jiri Denemark <jdenemar@xxxxxxxxxx>



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux