Fix ReadFileToBuffer to return 0 on failure (-1 is too large if returned as size_t).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156538 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc
index 52be83d..366e109 100644
--- a/lib/asan/asan_rtl.cc
+++ b/lib/asan/asan_rtl.cc
@@ -86,7 +86,7 @@
// The files we usually open are not seekable, so try different buffer sizes.
for (size_t size = kMinFileLen; size <= max_len; size *= 2) {
int fd = AsanOpenReadonly(file_name);
- if (fd < 0) return -1;
+ if (fd < 0) return 0;
AsanUnmapOrDie(*buff, *buff_size);
*buff = (char*)AsanMmapSomewhereOrDie(size, __FUNCTION__);
*buff_size = size;