ruby-changes:64931
From: Kazuhiro <ko1@a...>
Date: Mon, 18 Jan 2021 12:43:55 +0900 (JST)
Subject: [ruby-changes:64931] 6abf393e8f (master): OpenBSD has getentropy, but no sys/random.h
https://git.ruby-lang.org/ruby.git/commit/?id=6abf393e8f From 6abf393e8f372464322dc0a8c2bda80f8b389acd Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Mon, 18 Jan 2021 12:41:58 +0900 Subject: 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. ``` diff --git a/configure.ac b/configure.ac index f672f6d..e4bdf9f 100644 --- a/configure.ac +++ b/configure.ac @@ -1195,6 +1195,7 @@ AC_CHECK_HEADERS(sys/ioctl.h) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1195 AC_CHECK_HEADERS(sys/mkdev.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/prctl.h) +AC_CHECK_HEADERS(sys/random.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/sendfile.h) diff --git a/random.c b/random.c index 7b78efe..c11cd80 100644 --- a/random.c +++ b/random.c @@ -50,7 +50,9 @@ https://github.com/ruby/ruby/blob/trunk/random.c#L50 #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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/