xiaoxiang781216 commented on code in PR #3720:
URL: https://github.com/apache/nuttx-apps/pull/3720#discussion_r3789580379
##########
system/nxpkg/pkg_install.c:
##########
@@ -196,46 +262,49 @@ static int pkg_install_update_installed(FAR struct
pkg_installed_db_s *db,
}
entry->type = manifest->type;
- return pkg_install_add_version(entry, manifest->version);
+ return pkg_install_add_version(entry, manifest->version, pruned_version,
+ pruned_version_size);
}
static int pkg_install_write_pointers(
FAR const struct pkg_installed_db_s *db,
- FAR const struct pkg_manifest_s *manifest)
+ FAR const char *name)
{
FAR struct pkg_installed_entry_s *entry;
char current[PATH_MAX];
char previous[PATH_MAX];
int ret;
entry = pkg_metadata_find_installed((FAR struct pkg_installed_db_s *)db,
- manifest->name);
+ name);
if (entry == NULL)
{
- return -ENOENT;
+ ret = -ENOENT;
+ goto out;
}
- ret = pkg_store_format_current_path(current, sizeof(current),
- manifest->name);
+ ret = pkg_store_format_current_path(current, PATH_MAX, name);
if (ret < 0)
{
- return ret;
+ goto out;
}
- ret = pkg_store_format_previous_path(previous, sizeof(previous),
- manifest->name);
+ ret = pkg_store_format_previous_path(previous, PATH_MAX, name);
if (ret < 0)
{
- return ret;
+ goto out;
}
ret = pkg_store_write_text_atomic(current, entry->current);
if (ret < 0)
{
- return ret;
+ goto out;
}
- return pkg_store_write_text_atomic(previous, entry->previous);
+ ret = pkg_store_write_text_atomic(previous, entry->previous);
+
+out:
Review Comment:
remove out and return directly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]