
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1196272229 28800 # Node ID 06430b32cb03cf118ec1c8e866b2bc12ad7513a3 # Parent ca82a00fd6dafc045f2d5958feeb2decb2f750bc Fixes to SystemDevice for libcmpiutil API change Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r ca82a00fd6da -r 06430b32cb03 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_SystemDevice.c Wed Nov 28 09:50:29 2007 -0800 @@ -158,14 +158,13 @@ static CMPIStatus sys_to_dev(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *host = NULL; + const char *host = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; int ret; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - host = cu_get_str_path(ref, "Name"); - if (host == NULL) { + if (cu_get_str_path(ref, "Name", &host) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing Name"); @@ -205,7 +204,7 @@ static CMPIStatus dev_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *devid = NULL; + const char *devid = NULL; char *host = NULL; char *dev = NULL; CMPIInstance *sys; @@ -213,8 +212,7 @@ static CMPIStatus dev_to_sys(const CMPIO ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - devid = cu_get_str_path(ref, "DeviceID"); - if (devid == NULL) { + if (cu_get_str_path(ref, "DeviceID", &devid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -242,7 +240,6 @@ static CMPIStatus dev_to_sys(const CMPIO out: free(dev); free(host); - free(devid); return s; }