Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: runtime/bin/crypto_linux.cc

Issue 165723007: Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tiny fix. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/crypto_android.cc ('k') | runtime/bin/crypto_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « runtime/bin/crypto_android.cc ('k') | runtime/bin/crypto_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698