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

Unified Diff: runtime/bin/crypto_fuchsia.cc

Issue 2479683002: Use the new argument ordering for mx_cprng_draw (Closed)
Patch Set: Use the new argument ordering for mx_cprng_draw Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/crypto_fuchsia.cc
diff --git a/runtime/bin/crypto_fuchsia.cc b/runtime/bin/crypto_fuchsia.cc
index 04c5f2254760ee7b279625a1190d32a34b5ddcb4..b4c84d01ef8fa745863c3ecbf698b3289a36caa6 100644
--- a/runtime/bin/crypto_fuchsia.cc
+++ b/runtime/bin/crypto_fuchsia.cc
@@ -19,8 +19,9 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
const intptr_t len =
(MX_CPRNG_DRAW_MAX_LEN < remaining) ? MX_CPRNG_DRAW_MAX_LEN
: remaining;
- const mx_ssize_t res = mx_cprng_draw(buffer + read, len);
- if (res == ERR_INVALID_ARGS) {
+ mx_size_t res = 0;
+ const mx_status_t status = mx_cprng_draw(buffer + read, len, &res);
+ if (status != NO_ERROR) {
return false;
}
read += res;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698