From: Zbigniew Jędrzejewski-Szmek Date: Wed, 19 Apr 2017 20:13:27 +0000 (-0400) Subject: basic/random-util: add new header for getrandom() X-Git-Tag: chiark/234.4-1+devuan1.1+iwj1~163 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=sidebyside;h=28f5f07114eaa10d1ebcd46efbebcb05a7c51470;p=elogind.git basic/random-util: add new header for getrandom() There's some confusion: older man pages specify that linux/random.h contains getrandom, but newer glibc has it in sys/random.h. Detect if the newer header is available and include it. We still need the older header for the flags. --- diff --git a/src/basic/random-util.c b/src/basic/random-util.c index ad7b3eedf..b216be579 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -27,7 +27,13 @@ #include #ifdef HAVE_SYS_AUXV_H -#include +# include +#endif + +#ifdef USE_SYS_RANDOM_H +# include +#else +# include #endif #include "fd-util.h"