Fix fdsan error
fdopendir takes ownership of the fd, use the new Fdopendir helper
function instead.
Test: adb shell /data/nativetest64/installd_dexopt_test/installd_dexopt_test
Bug: 118818285
Change-Id: I84c594979da85ab9d33e06da077119319368d219
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp
index 6b9cf0d..74ad184 100644
--- a/cmds/installd/utils.cpp
+++ b/cmds/installd/utils.cpp
@@ -43,6 +43,7 @@
#define DEBUG_XATTRS 0
using android::base::EndsWith;
+using android::base::Fdopendir;
using android::base::StringPrintf;
using android::base::unique_fd;
@@ -1036,7 +1037,7 @@
continue;
}
- DIR* subdir = fdopendir(subdir_fd);
+ DIR* subdir = Fdopendir(std::move(subdir_fd));
if (subdir == nullptr) {
PLOG(WARNING) << "Could not open dir path " << local_path;
result = false;