From 1eefc325594333bd3bc58006acb641a28d465606 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Tue, 11 Jan 2022 17:17:38 +1100 Subject: Use getentropy on macOS --- passgen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/passgen.c b/passgen.c index 2220be6..af51d4f 100644 --- a/passgen.c +++ b/passgen.c @@ -6,7 +6,7 @@ #include #include -#ifdef __linux__ +#if defined (__linux__) || defined (__APPLE__) #include #else #include @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) } password[grammar_size] = 0; -#ifndef __linux__ +#if ! defined (__linux__) && ! defined (__APPLE__) /* * TODO: seed better RNG * this isn't very good, but it's enough(?) for now @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) } do { -#ifdef __linux__ +#if defined (__linux__) || defined (__APPLE__) unsigned int r; getentropy(&r, sizeof(r)); #else -- cgit