[Libvirt-cim] [PATCH] if statement in state_change() in CS expects incorrect return value

Jay Gagnon grendel at linux.vnet.ibm.com
Wed Dec 19 14:58:18 UTC 2007


Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1197946011 28800
> # Node ID 6f5ab2a959deeb6e13e8f684a014bec9fda36032
> # Parent  8d761c7477e78302fb7dfea2ac6d82cc58974dd5
> if statement in state_change() in CS expects incorrect return value.
>
> cu_get_u16_arg() returns CMPI_RC_OK upon success.
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 8d761c7477e7 -r 6f5ab2a959de src/Virt_ComputerSystem.c
> --- a/src/Virt_ComputerSystem.c	Fri Dec 14 16:13:18 2007 -0800
> +++ b/src/Virt_ComputerSystem.c	Mon Dec 17 18:46:51 2007 -0800
> @@ -662,7 +662,7 @@ static CMPIStatus state_change(CMPIMetho
>          const char *name = NULL;
>
>          ret = cu_get_u16_arg(argsin, "RequestedState", &state);
> -        if (!ret) {
> +        if (ret != CMPI_RC_OK) {
>                  CMSetStatus(&s, CMPI_RC_ERR_INVALID_PARAMETER);
>                  goto out;
>          }
>
>   

Oops, nice spot!  +1

-- 

-Jay




More information about the Libvirt-cim mailing list