Chromium Code Reviews| Index: runtime/bin/crypto_openbsd.cc |
| diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_openbsd.cc |
| similarity index 90% |
| copy from runtime/bin/crypto_android.cc |
| copy to runtime/bin/crypto_openbsd.cc |
| index 4b55b910146141e8ad1a9277c76909f9d7eada9e..04cffe5db59cad82c4e319cb9e334b0f192da2f7 100644 |
| --- a/runtime/bin/crypto_android.cc |
| +++ b/runtime/bin/crypto_openbsd.cc |
| @@ -3,7 +3,7 @@ |
| // BSD-style license that can be found in the LICENSE file. |
| #include "platform/globals.h" |
| -#if defined(TARGET_OS_ANDROID) |
| +#if defined(TARGET_OS_OPENBSD) |
| #include <errno.h> // NOLINT |
| #include <fcntl.h> // NOLINT |
| @@ -17,6 +17,7 @@ |
| namespace dart { |
| namespace bin { |
| +// TODO(mulander): Consider using getentropy(2) |
|
Ivan Posva
2016/01/11 23:58:40
Once you get there, please explain why you do use
mulander
2016/01/12 00:22:45
You are correct. When that comment was made it was
|
| bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { |
| ThreadSignalBlocker signal_blocker(SIGPROF); |
| intptr_t fd = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER( |
| @@ -41,4 +42,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { |
| } // namespace bin |
| } // namespace dart |
| -#endif // defined(TARGET_OS_ANDROID) |
| +#endif // defined(TARGET_OS_OPENBSD) |