[ASan] use internal_open from sanitizer_libc in ASan runtime

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157986 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc
index 5f80797..b9603a4 100644
--- a/lib/asan/asan_rtl.cc
+++ b/lib/asan/asan_rtl.cc
@@ -21,6 +21,7 @@
 #include "asan_stats.h"
 #include "asan_thread.h"
 #include "asan_thread_registry.h"
+#include "sanitizer_common/sanitizer_libc.h"
 
 namespace __asan {
 using namespace __sanitizer;
@@ -86,7 +87,7 @@
   *buff_size = 0;
   // The files we usually open are not seekable, so try different buffer sizes.
   for (uptr size = kMinFileLen; size <= max_len; size *= 2) {
-    int fd = AsanOpenReadonly(file_name);
+    fd_t fd = internal_open(file_name, /*write*/ false);
     if (fd < 0) return 0;
     AsanUnmapOrDie(*buff, *buff_size);
     *buff = (char*)AsanMmapSomewhereOrDie(size, __FUNCTION__);