From 214989d14a3c62c0f5554e03a74da04e4796390a Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 17 Jul 2013 11:09:10 +0200 Subject: LogicalFile: use get_string_property_from_op() where appropriate --- src/logicalfile/LMI_FileIdentityProvider.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'src/logicalfile/LMI_FileIdentityProvider.c') diff --git a/src/logicalfile/LMI_FileIdentityProvider.c b/src/logicalfile/LMI_FileIdentityProvider.c index fe3324f..d31c305 100644 --- a/src/logicalfile/LMI_FileIdentityProvider.c +++ b/src/logicalfile/LMI_FileIdentityProvider.c @@ -65,8 +65,6 @@ static CMPIStatus associators( CMPIInstance *ci; CMPIObjectPath *o; const char *ns = KNameSpace(cop); - CMPIData pathd; - CMPIData cd; char fileclass[BUFLEN]; char *fsname; @@ -83,10 +81,8 @@ static CMPIStatus associators( return st; } - pathd = CMGetKey(cop, "LFName", &st); - cd = CMGetKey(cop, "LFCreationClassName", &st); - const char *path = KChars(pathd.value.string); - const char *ccname = KChars(cd.value.string); + const char *path = get_string_property_from_op(cop, "LFName"); + const char *ccname = get_string_property_from_op(cop, "LFCreationClassName"); get_class_from_path(path, fileclass); if (get_fsname_from_path(path, &fsname) < 0) { CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, "Can't get filesystem name"); @@ -111,9 +107,7 @@ static CMPIStatus associators( return st; } - pathd = CMGetKey(cop, "Name", &st); - cd = CMGetKey(cop, "CreationClassName", &st); - const char *path = KChars(pathd.value.string); + const char *path = get_string_property_from_op(cop, "Name"); get_class_from_path(path, fileclass); if (get_fsname_from_path(path, &fsname) < 0) { CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, "Can't get filesystem name"); @@ -152,8 +146,6 @@ static CMPIStatus references( { LMI_FileIdentity lmi_fi; CMPIStatus st, res; - CMPIData pathd; - CMPIData cd; const char *ns = KNameSpace(cop); CMPIInstance *ci; CMPIObjectPath *o; @@ -181,10 +173,8 @@ static CMPIStatus references( return st; } - pathd = CMGetKey(cop, "LFName", &st); - cd = CMGetKey(cop, "LFCreationClassName", &st); - const char *path = KChars(pathd.value.string); - const char *ccname = KChars(cd.value.string); + const char *path = get_string_property_from_op(cop, "LFName"); + const char *ccname = get_string_property_from_op(cop, "LFCreationClassName"); get_class_from_path(path, fileclass); if (get_fsname_from_path(path, &fsname) < 0) { CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, "Can't get filesystem name"); @@ -212,10 +202,8 @@ static CMPIStatus references( return st; } - pathd = CMGetKey(cop, "Name", &st); - cd = CMGetKey(cop, "CreationClassName", &st); - const char *path = KChars(pathd.value.string); - const char *ccname = KChars(cd.value.string); + const char *path = get_string_property_from_op(cop, "Name"); + const char *ccname = get_string_property_from_op(cop, "CreationClassName"); if (get_fsname_from_path(path, &fsname) < 0) { CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, "Can't get filesystem name"); } -- cgit