components/python/python35/patches/26-getrandom.patch
changeset 7648 20e09cf3cfaa
parent 6447 56a2f066191a
--- a/components/python/python35/patches/26-getrandom.patch	Mon Feb 06 13:55:35 2017 -0800
+++ b/components/python/python35/patches/26-getrandom.patch	Mon Feb 06 13:54:36 2017 -0800
@@ -2,14 +2,14 @@
 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) {
+--- Python-3.5.3/Python/random.c.~1~	2017-01-17 11:31:43.712295534 +0000
++++ Python-3.5.3/Python/random.c	2017-01-17 11:34:15.498815511 +0000
+@@ -185,7 +185,7 @@
+             /* ENOSYS: getrandom() syscall not supported by the kernel (but
+              * maybe supported by the host which built Python). EPERM:
+              * getrandom() syscall blocked by SECCOMP or something else. */
+-            if (errno == ENOSYS || errno == EPERM) {
++            if (errno == ENOSYS || errno == EINVAL || errno == EPERM) {
                  getrandom_works = 0;
                  return 0;
              }