diff options
Diffstat (limited to 'src/logicalfile/LMI_DirectoryContainsFileProvider.c')
-rw-r--r-- | src/logicalfile/LMI_DirectoryContainsFileProvider.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/logicalfile/LMI_DirectoryContainsFileProvider.c b/src/logicalfile/LMI_DirectoryContainsFileProvider.c index bcf6d14..8511bfa 100644 --- a/src/logicalfile/LMI_DirectoryContainsFileProvider.c +++ b/src/logicalfile/LMI_DirectoryContainsFileProvider.c @@ -51,17 +51,17 @@ static CMPIStatus logicalfile_objectpath_from_path( CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, err); } else { get_class_from_stat(&sb, fileclass); - st = lmi_check_assoc_class(_cb, namespace, resultClass, fileclass); + st = lmi_class_path_is_a(_cb, namespace, fileclass, resultClass); if (st.rc == LMI_RC_ERR_CLASS_CHECK_FAILED) { st.rc = CMPI_RC_OK; *o = NULL; return st; } /* check status again for other possible errors */ - lmi_check_status(st); + lmi_return_if_status_not_ok(st); st = get_fsinfo_from_stat(_cb, &sb, abspath, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); } CIM_LogicalFileRef cim_lfr; @@ -107,7 +107,7 @@ static CMPIStatus dir_file_objectpaths( dirname = g_path_get_dirname(path); st = logicalfile_objectpath_from_path(dirname, resultClass, namespace, &o); g_free(dirname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); if (o) { ops[i++] = o; } @@ -160,8 +160,8 @@ static CMPIStatus associators( int group = -1; int rgroup = -1; - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_DirectoryContainsFile_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_DirectoryContainsFile_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); /* role && resultRole checks */ if (role) { if (strcmp(role, LMI_GROUP_COMPONENT) != 0 && strcmp(role, LMI_PART_COMPONENT) != 0) { @@ -189,7 +189,7 @@ static CMPIStatus associators( if (CMClassPathIsA(_cb, cop, LMI_UnixDirectory_ClassName, &st)) { /* got UnixDirectory - GroupComponent */ - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -216,7 +216,7 @@ static CMPIStatus associators( } } else if (CMClassPathIsA(_cb, cop, CIM_LogicalFile_ClassName, &st)) { /* got LogicalFile - PartComponent */ - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -226,8 +226,8 @@ static CMPIStatus associators( path = lmi_get_string_property_from_objectpath(cop, "Name"); if (!path) CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Cannot find Name property in provided CIM_logicalFile"); - st = lmi_check_assoc_class(_cb, ns, resultClass, LMI_UnixDirectory_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_UnixDirectory_ClassName, resultClass); + lmi_return_if_class_check_not_ok(st); CIM_DirectoryRef lmi_dr; CIM_DirectoryRef_Init(&lmi_dr, _cb, ns); @@ -236,7 +236,7 @@ static CMPIStatus associators( char *fsclassname = NULL; st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); gchar *dirname = g_path_get_dirname(path); fill_logicalfile(CIM_DirectoryRef, &lmi_dr, dirname, fsclassname, fsname, LMI_UnixDirectory_ClassName); @@ -283,8 +283,8 @@ static CMPIStatus references( CMPIInstance *ci; int group = -1; - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_DirectoryContainsFile_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_DirectoryContainsFile_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); if (role) { if (strcmp(role, LMI_GROUP_COMPONENT) != 0 && strcmp(role, LMI_PART_COMPONENT) != 0) { CMReturn(CMPI_RC_OK); @@ -301,13 +301,13 @@ static CMPIStatus references( if (CMClassPathIsA(_cb, cop, LMI_UnixDirectory_ClassName, &st)) { - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); path = lmi_get_string_property_from_objectpath(cop, "Name"); if (!path) CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Cannot find Name property in provided LMI_UnixDirectory"); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); /* got GroupComponent - DirectoryRef */ fill_logicalfile(CIM_DirectoryRef, &lmi_dr, path, fsclassname, fsname, LMI_UnixDirectory_ClassName); o = CIM_DirectoryRef_ToObjectPath(&lmi_dr, &st); @@ -318,7 +318,7 @@ static CMPIStatus references( CMPIObjectPath *refs[MAX_REFS]; unsigned int count = 0; st = dir_file_objectpaths(cc, cr, NULL, group, -1, properties, ns, path, refs, &count); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); if (count > MAX_REFS) { CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Too many files in a single directory..."); } @@ -335,14 +335,14 @@ static CMPIStatus references( } } } else if (CMClassPathIsA(_cb, cop, CIM_LogicalFile_ClassName, &st)) { - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); path = lmi_get_string_property_from_objectpath(cop, "Name"); if (!path) CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Cannot find Name property in provided CIM_LogicalFile"); get_class_from_path(path, ccname); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); /* got PartComponent - LogicalFileRef */ if (group == 1) { CMReturn(CMPI_RC_OK); |