ret = app_manager_get_app_info(app_id, &app_info);
if (ret != APP_MANAGER_ERROR_NONE) {
fprintf(stderr, "No corresponding app_id for [%s]\n", app_id);
- return APP_MANAGER_ERROR_NO_SUCH_APP;
+ return ret;
}
- app_info_get_app_id(app_info, &appid);
- app_info_get_label(app_info, &label);
- app_info_get_icon(app_info, &icon);
- app_info_get_package(app_info, &package);
- app_info_get_type(app_info, &type);
+ ret = app_info_get_app_id(app_info, &appid);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ fprintf(stderr, "Failed to get app_id. error(%d)\n", ret);
+ goto end;
+ }
+
+ ret = app_info_get_label(app_info, &label);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ fprintf(stderr, "Failed to get label. error(%d)\n", ret);
+ goto end;
+ }
+
+ ret = app_info_get_icon(app_info, &icon);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ fprintf(stderr, "Failed to get icon. error(%d)\n", ret);
+ goto end;
+ }
+
+ ret = app_info_get_package(app_info, &package);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ fprintf(stderr, "Failed to get package. error(%d)\n", ret);
+ goto end;
+ }
+
+ ret = app_info_get_type(app_info, &type);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ fprintf(stderr, "Failed to get type. error(%d)\n", ret);
+ goto end;
+ }
fprintf(stderr, "appid = [%s]\n", appid);
fprintf(stderr, "label = [%s]\n", label);
fprintf(stderr, "package = [%s]\n", package);
fprintf(stderr, "type = [%s]\n", type);
- ret = app_info_destroy(app_info);
- if (ret != APP_MANAGER_ERROR_NONE)
- return APP_MANAGER_ERROR_IO_ERROR;
-
+end:
free(appid);
free(label);
free(icon);
free(package);
free(type);
- return APP_MANAGER_ERROR_NONE;
+ app_info_destroy(app_info);
+
+ return ret;
}
int main(int argc, char **argv)