components/python/python35/patches/26-getrandom.patch
author John Beck <John.Beck@Oracle.COM>
Tue, 15 Dec 2015 09:07:54 -0800
changeset 5199 36df3dbf2f0f
child 6447 56a2f066191a
permissions -rw-r--r--
22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5199
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     1
This patch was originated in-house.  It is to work around a bug (21825650)
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     2
in getrandom(2).  That bug was fixed in S12, and in an 11.3 SRU, but not in
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     3
time for 11.3 GA, so this patch is still needed for FOSS Evaluation builds.
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     4
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     5
--- Python-3.5.1/Python/random.c.~1~	2015-08-25 10:19:14.000000000 -0700
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     6
+++ Python-3.5.1/Python/random.c	2015-09-02 14:18:51.799090171 -0700
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     7
@@ -136,7 +136,7 @@
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     8
         }
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     9
 
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    10
         if (n < 0) {
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    11
-            if (errno == ENOSYS) {
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    12
+            if (errno == ENOSYS || errno == EINVAL) {
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    13
                 getrandom_works = 0;
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    14
                 return 0;
36df3dbf2f0f 22372924 Restore Python 3.5 getrandom patch for FOSS Evaluation build
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    15
             }