Use assignment instead of reset for profile unique_fd
Using reset with a unique_fd will just convert the unique_fd to int
without releasing it.
Test: adb shell cmd package compile -m speed-profile com.google.android.googlequicksearchbox
Bug: 36234017
Change-Id: I577197ac4a147765191777a5ebc6ef150dea1027
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index a5ac8a4..0d5652f 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -529,7 +529,7 @@
static void open_profile_files(uid_t uid, const std::string& pkgname,
/*out*/ std::vector<unique_fd>* profiles_fd, /*out*/ unique_fd* reference_profile_fd) {
// Open the reference profile in read-write mode as profman might need to save the merge.
- reference_profile_fd->reset(open_reference_profile(uid, pkgname, /*read_write*/ true));
+ *reference_profile_fd = open_reference_profile(uid, pkgname, /*read_write*/ true);
if (reference_profile_fd->get() < 0) {
// We can't access the reference profile file.
return;