fix up freebsd11 build (dump getrandom(2))

pull/1838/head
nick black 3 years ago
parent e287187108
commit 23b19581e8

@ -413,7 +413,7 @@ bool is_linux_console(int fd, unsigned no_font_changes, bool* quadrants){
}
#else
bool is_linux_console(int fd, unsigned no_font_changes, bool* quadrants){
(void)nc;
(void)fd;
(void)no_font_changes;
(void)quadrants;
return false;

@ -1,4 +1,3 @@
#include <sys/random.h>
#include <notcurses/notcurses.h>
static int
@ -8,7 +7,9 @@ interp(struct notcurses* nc, int cellpixy, int cellpixx){
ncplane_printf_yx(stdn, 10, 0, "press any key to continue");
size_t rands = cellpixy * cellpixx * 3;
unsigned char* randrgb = malloc(rands);
getrandom(randrgb, rands, GRND_NONBLOCK);
for(size_t r = 0 ; r < rands ; ++r){
randrgb[r] = random() % 256;
}
struct ncvisual* ncv = ncvisual_from_rgb_packed(randrgb, cellpixy, cellpixx * 3, cellpixx, 0xff);
if(ncv == NULL){
return -1;

Loading…
Cancel
Save