diff --git a/CMakeLists.txt b/CMakeLists.txt index 04790815..e320fafc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/src/crypto/random.c b/src/crypto/random.c index bdac1e7a..a54bdf74 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -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); } }