Misc cleanups and performance improvements.
- There's no need to check rval for prop_dictionary_get_*, we are sure the objects are there at prop_dictionary_set_* time. - Avoid two chdir(2) calls per INSTALL/REMOVE run. - Avoid using access(2) to check for existence of INSTALL/REMOVE scripts, just try to run the executable directly and check for ENOENT.
This commit is contained in:
@ -164,11 +164,7 @@ show_pkg_files(prop_dictionary_t filesd)
|
||||
return EINVAL;
|
||||
|
||||
while ((obj = prop_object_iterator_next(iter))) {
|
||||
if (!prop_dictionary_get_cstring_nocopy(obj,
|
||||
"file", &file)) {
|
||||
prop_object_iterator_release(iter);
|
||||
return errno;
|
||||
}
|
||||
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
|
||||
printf("%s\n", file);
|
||||
}
|
||||
prop_object_iterator_release(iter);
|
||||
|
Reference in New Issue
Block a user