aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--passgen.c6
1 files 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 <string.h>
#include <unistd.h>
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
#include <sys/random.h>
#else
#include <time.h>
@@ -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