| 1 | diff -u -r ../Python-3.5.1/Python/fileutils.c ./Python/fileutils.c |
| 2 | --- ../Python-3.5.1/Python/fileutils.c 2015-12-06 20:39:11.000000000 -0500 |
| 3 | +++ ./Python/fileutils.c 2016-05-18 19:46:49.466741203 -0400 |
| 4 | @@ -856,7 +856,7 @@ |
| 5 | return 0; |
| 6 | } |
| 7 | |
| 8 | - if (errno != ENOTTY) { |
| 9 | + if (errno != ENOTTY && errno != EACCES) { |
| 10 | if (raise) |
| 11 | PyErr_SetFromErrno(PyExc_OSError); |
| 12 | return -1; |
| 13 | @@ -865,7 +865,9 @@ |
| 14 | /* Issue #22258: Here, ENOTTY means "Inappropriate ioctl for |
| 15 | device". The ioctl is declared but not supported by the kernel. |
| 16 | Remember that ioctl() doesn't work. It is the case on |
| 17 | - Illumos-based OS for example. */ |
| 18 | + Illumos-based OS for example. |
| 19 | + EACCES may be the result of an SELinux policy disabling |
| 20 | + ioctl on sockets. This is the case on Android. */ |
| 21 | ioctl_works = 0; |
| 22 | } |
| 23 | /* fallback to fcntl() if ioctl() does not work */ |