[Python-checkins] cpython (3.5): only include sys/random.h if it seems like it might have something useful

benjamin.peterson python-checkins at python.org
Sun Jan 1 23:31:02 EST 2017


https://hg.python.org/cpython/rev/9ab75789c554
changeset:   105951:9ab75789c554
branch:      3.5
parent:      105945:ad0ec4969adf
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Jan 01 22:29:36 2017 -0600
summary:
  only include sys/random.h if it seems like it might have something useful (#29057)

files:
  Python/random.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Python/random.c b/Python/random.c
--- a/Python/random.c
+++ b/Python/random.c
@@ -9,7 +9,7 @@
 #  ifdef HAVE_LINUX_RANDOM_H
 #    include <linux/random.h>
 #  endif
-#  ifdef HAVE_SYS_RANDOM_H
+#  if defined(HAVE_SYS_RANDOM_H) && (defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY))
 #    include <sys/random.h>
 #  endif
 #  if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list