From 851bd057ecfa2997252429f86362b0a710a1af8d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 26 Jan 2018 10:35:13 +0000 Subject: call _exit instead of abort in release mode Avoids cores being created, as they're nowadays often piped to some call home system --- src/crypto/random.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/crypto/random.c') diff --git a/src/crypto/random.c b/src/crypto/random.c index 691c31f62..14a028fc9 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -45,7 +45,11 @@ static void generate_system_random_bytes(size_t n, void *result); static void generate_system_random_bytes(size_t n, void *result) { HCRYPTPROV prov; +#ifdef NDEBUG +#define must_succeed(x) do if (!(x)) { fprintf(stderr, "Failed: " #x); _exit(1); } while (0) +#else #define must_succeed(x) do if (!(x)) abort(); while (0) +#endif must_succeed(CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)); must_succeed(CryptGenRandom(prov, (DWORD)n, result)); must_succeed(CryptReleaseContext(prov, 0)); -- cgit v1.2.3