mirror of
https://github.com/monero-project/monero.git
synced 2025-08-23 06:25:07 -04:00
call _exit instead of abort in release mode
Avoids cores being created, as they're nowadays often piped to some call home system
This commit is contained in:
parent
09d19c9139
commit
851bd057ec
6 changed files with 49 additions and 7 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue