Index: runtime/bin/crypto_linux.cc |
diff --git a/runtime/bin/crypto_linux.cc b/runtime/bin/crypto_linux.cc |
index 849fe71a3f0f07e923c298a722886ad2d5624516..905bf77481a62744282c285f810c79d76f96eb43 100644 |
--- a/runtime/bin/crypto_linux.cc |
+++ b/runtime/bin/crypto_linux.cc |
@@ -10,6 +10,7 @@ |
#include "bin/fdutils.h" |
#include "bin/crypto.h" |
+#include "platform/signal_blocker.h" |
namespace dart { |
@@ -18,8 +19,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 = TEMP_FAILURE_RETRY(read(fd, buffer, count)); |
+ VOID_TEMP_FAILURE_RETRY(close(fd)); |
return bytes_read == count; |
} |