Re: [PATCH v4 21/23] virSecuritySELinuxRestoreFileLabel: Adjust code pattern

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

 




On 09/10/2018 05:36 AM, Michal Privoznik wrote:
> Firstly, the following code pattern is harder to follow:
> 
>   if (func() < 0) {
>       error();
>   } else {
>       /* success */
>   }
> 
> We should put 'goto cleanup' into the error branch and move the
> else branch one level up.
> Secondly, 'rc' should really be named 'ret' because it holds
> return value of the function. Not some intermediate value.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/security/security_selinux.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>

John

can't wait to see the selinux patches for this list stuff... Oh boy!
Getting punchy, must be closer to dinner...

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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