summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-14 21:47:43 (GMT)
committerGitHub <noreply@github.com>2019-08-14 21:47:43 (GMT)
commit123f6c4914827c4ced65d032fab74de62db31cd6 (patch)
tree1cd9bf3bf4fd632719d119bfd3f4f18220d3ff1c /Python/pythonrun.c
parent557802dc17498557e481f2ad3d4a83ece469e489 (diff)
downloadcpython-123f6c4914827c4ced65d032fab74de62db31cd6.zip
cpython-123f6c4914827c4ced65d032fab74de62db31cd6.tar.gz
cpython-123f6c4914827c4ced65d032fab74de62db31cd6.tar.bz2
bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
FreeBSD implementation of poll(2) restricts the timeout argument to be either zero, or positive, or equal to INFTIM (-1). Unless otherwise overridden, socket timeout defaults to -1. This value is then converted to milliseconds (-1000) and used as argument to the poll syscall. poll returns EINVAL (22), and the connection fails. This bug was discovered during the EINTR handling testing, and the reproduction code can be found in https://bugs.python.org/issue23618 (see connect_eintr.py, attached). On GNU/Linux, the example runs as expected. This change is trivial: If the supplied timeout value is negative, truncate it to -1. (cherry picked from commit 28146206578ebe1b84b48e6f255738a227058c04) Co-authored-by: Artem Khramov <akhramov@pm.me>
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions