waitpid(pid, &status, 0);
}
- /* remove a file after installation,
- * keep rw packages for factory-reset
- */
- if (readonly) {
- ret = remove(file_path);
- if (ret < 0) {
- _E("Failed to remove [%s]: [%s]",
- file_path, strerror_r(errno, err_buf,
- sizeof(err_buf)));
- closedir(dir);
- g_list_free_full(preload_rw_pkg_list, free);
- return -1;
- }
- } else {
+ if (!readonly) {
// make the preload-rw list
pkg_info = pkgmgr_client_check_pkginfo_from_file(file_path);
if (pkg_info == NULL) {
pkgmgr_client_free_pkginfo(pkg_info);
pkg_info = NULL;
}
+
+ /* remove a file after installation */
+ ret = remove(file_path);
+ if (ret < 0) {
+ _E("Failed to remove [%s]: [%s]", file_path,
+ strerror_r(errno, err_buf,
+ sizeof(err_buf)));
+ closedir(dir);
+ g_list_free_full(preload_rw_pkg_list, free);
+ return -1;
+ }
}
closedir(dir);