Skip to content

Commit

Permalink
[vm/sigprof] Disable checking of sigprof on mac.
Browse files Browse the repository at this point in the history
Fixes #41239

Change-Id: I397f70c7d9977bbf8ce33ce649c7d82e02fd26a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151880
Reviewed-by: Ryan Macnak <[email protected]>
Commit-Queue: Alexander Aprelev <[email protected]>
  • Loading branch information
aam authored and [email protected] committed Jun 19, 2020
1 parent 2e50075 commit 94fcf22
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions runtime/bin/crypto_macos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ namespace dart {
namespace bin {

bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
ThreadSignalBlocker signal_blocker(SIGPROF);
intptr_t fd = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
open("/dev/urandom", O_RDONLY | O_CLOEXEC));
intptr_t fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY | O_CLOEXEC));
if (fd < 0) {
return false;
}
intptr_t bytes_read = 0;
do {
int res = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
read(fd, buffer + bytes_read, count - bytes_read));
int res =
TEMP_FAILURE_RETRY(read(fd, buffer + bytes_read, count - bytes_read));
if (res < 0) {
int err = errno;
close(fd);
Expand Down

0 comments on commit 94fcf22

Please sign in to comment.