forked from lthn/blockchain
latest fixes for cake wallet
This commit is contained in:
parent
0c90262e8a
commit
fde28efdc5
2 changed files with 10 additions and 5 deletions
|
|
@ -226,7 +226,12 @@ endif()
|
|||
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 12.00)
|
||||
set(Boost_LIBRARIES "libboost.a")
|
||||
if(NOT DEFINED SKIP_BOOST_FATLIB_LIB OR NOT SKIP_BOOST_FATLIB_LIB)
|
||||
message("Ios: libboost.a included as library")
|
||||
set(Boost_LIBRARIES "libboost.a")
|
||||
else()
|
||||
message("Ios: libboost.a not included as library")
|
||||
endif()
|
||||
#workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator)
|
||||
set(__iphoneos_archs "arm64")
|
||||
#set(__iphonesimulator_archs "arm64,x86_64")
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ void generate_system_random_bytes(size_t n, void *result) {
|
|||
void generate_system_random_bytes(size_t n, void *result) {
|
||||
int fd;
|
||||
if ((fd = open("/dev/urandom", O_RDONLY | O_NOCTTY | O_CLOEXEC)) < 0) {
|
||||
err(EXIT_FAILURE, "open /dev/urandom");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
for (;;) {
|
||||
ssize_t res = read(fd, result, n);
|
||||
|
|
@ -52,17 +52,17 @@ void generate_system_random_bytes(size_t n, void *result) {
|
|||
}
|
||||
if (res < 0) {
|
||||
if (errno != EINTR) {
|
||||
err(EXIT_FAILURE, "read /dev/urandom");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else if (res == 0) {
|
||||
errx(EXIT_FAILURE, "read /dev/urandom: end of file");
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
result = padd(result, (size_t) res);
|
||||
n -= (size_t) res;
|
||||
}
|
||||
}
|
||||
if (close(fd) < 0) {
|
||||
err(EXIT_FAILURE, "close /dev/urandom");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue