mirror of
https://github.com/janet-lang/janet
synced 2025-01-14 17:35:41 +00:00
BSD os.c fix with arc4random.
This commit is contained in:
parent
f1afc5b0b4
commit
58ff7f0788
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#ifndef JANET_REDUCED_OS
|
#ifndef JANET_REDUCED_OS
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -549,7 +550,6 @@ static Janet os_cryptorand(int32_t argc, Janet *argv) {
|
|||||||
}
|
}
|
||||||
RETRY_EINTR(rc, close(randfd));
|
RETRY_EINTR(rc, close(randfd));
|
||||||
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||||
(void) errmsg;
|
|
||||||
arc4random_buf(buffer->data + offset, n);
|
arc4random_buf(buffer->data + offset, n);
|
||||||
#else
|
#else
|
||||||
janet_panic("cryptorand currently unsupported on this platform");
|
janet_panic("cryptorand currently unsupported on this platform");
|
||||||
|
Loading…
Reference in New Issue
Block a user