]> granicus.if.org Git - python/commitdiff
only include sys/random.h if it seems like it might have something useful (#29057)
authorBenjamin Peterson <benjamin@python.org>
Mon, 2 Jan 2017 04:29:36 +0000 (22:29 -0600)
committerBenjamin Peterson <benjamin@python.org>
Mon, 2 Jan 2017 04:29:36 +0000 (22:29 -0600)
Python/random.c

index 944ef31ee2a5121a4907484151a17868a9eafb63..d20393926f2efec803f0d6f89c358d4369e92439 100644 (file)
@@ -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)