Index: runtime/bin/crypto_android.cc |
diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_android.cc |
index 8922a5e4c1942891c6addc8ad2065b2897ef2754..9a81ed17e9ff25f9d9c9fbf4fba2ac3100a29e3c 100644 |
--- a/runtime/bin/crypto_android.cc |
+++ b/runtime/bin/crypto_android.cc |
@@ -20,8 +20,8 @@ namespace bin { |
bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { |
intptr_t fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY)); |
if (fd < 0) return false; |
- intptr_t bytes_read = read(fd, buffer, count); |
- close(fd); |
+ intptr_t bytes_read = FDUtils::ReadFromBlocking(fd, buffer, count); |
+ VOID_TEMP_FAILURE_RETRY(close(fd)); |
return bytes_read == count; |
} |