components/python/python35/patches/26-getrandom.patch
author John Beck <John.Beck@Oracle.COM>
Thu, 21 Jul 2016 12:52:32 -0700
changeset 6447 56a2f066191a
parent 5199 36df3dbf2f0f
child 7648 20e09cf3cfaa
permissions -rw-r--r--
23858083 Upgrade Python to 3.5.2

This patch was originated in-house.  It is to work around a bug (21825650)
in getrandom(2).  That bug was fixed in S12, and in an 11.3 SRU, but not in
time for 11.3 GA, so this patch is still needed for FOSS Evaluation builds.

--- Python-3.5.2/Python/random.c.~1~	2016-06-25 14:38:38.000000000 -0700
+++ Python-3.5.2/Python/random.c	2016-07-08 07:09:56.389742049 -0700
@@ -171,7 +171,7 @@
 #endif
 
         if (n < 0) {
-            if (errno == ENOSYS) {
+            if (errno == ENOSYS || errno == EINVAL) {
                 getrandom_works = 0;
                 return 0;
             }