From 4eba6d702e7ca40875d7e2d30129672a43d9a28b Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 15 Mar 2017 13:20:39 -0700 Subject: [PATCH] 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 --- cmds/installd/dexopt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp index a5ac8a4d4e..0d5652fc49 100644 --- a/cmds/installd/dexopt.cpp +++ b/cmds/installd/dexopt.cpp @@ -529,7 +529,7 @@ static unique_fd open_reference_profile(uid_t uid, const std::string& pkgname, b static void open_profile_files(uid_t uid, const std::string& pkgname, /*out*/ std::vector* 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; -- 2.11.0