aboutsummaryrefslogtreecommitdiffstats
path: root/random.c
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-01-18 12:41:58 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-01-18 12:43:05 +0900
commit6abf393e8f372464322dc0a8c2bda80f8b389acd (patch)
treecf986bf08be5ee2470356970f76e5477c2e460a1 /random.c
parentbf640bbf8cef7f4575e782e35c4588cb138890b6 (diff)
downloadruby-6abf393e8f372464322dc0a8c2bda80f8b389acd.tar.gz
OpenBSD has getentropy, but no sys/random.h
https://man.openbsd.org/getentropy Try to fix https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20210118T023008Z.fail.html.gz ``` compiling random.c random.c:53:11: fatal error: 'sys/random.h' file not found # include <sys/random.h> ^~~~~~~~~~~~~~ 1 error generated. ```
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/random.c b/random.c
index 7b78efe7ca..c11cd803f2 100644
--- a/random.c
+++ b/random.c
@@ -50,7 +50,9 @@
#endif
#if defined HAVE_GETRANDOM || defined HAVE_GETENTROPY
-# include <sys/random.h>
+# if defined(HAVE_SYS_RANDOM_H)
+# include <sys/random.h>
+# endif
#elif defined __linux__ && defined __NR_getrandom
# include <linux/random.h>
#endif