[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread STINNER Victor
STINNER Victor added the comment: > Changes look pretty innocent. LGTM. Thanks. I pushed my change. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset d268f108ba80 by Victor Stinner in branch 'default': Avoid fcntl() if possible in set_inheritable() https://hg.python.org/cpython/rev/d268f108ba80 -- nosy: +python-dev ___ Python tracker

[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread STINNER Victor
STINNER Victor added the comment: > Another question: should we handle EINTR in ioctl() and fcntl()? But this is > a different issue. See attached test stress.py. I tried it with ioctl() and fcntl() implementations of os.set_inheritable() and I got more than 10,000 signals: no syscalls

[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Another question: should we handle EINTR in ioctl() and fcntl()? But this is a different issue. -- ___ Python tracker

[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Changes look pretty innocent. LGTM. -- assignee: -> haypo nosy: +steve.dower stage: -> commit review ___ Python tracker

[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-15 Thread STINNER Victor
STINNER Victor added the comment: See also the issue #26769: "Python 2.7: make private file descriptors non inheritable". -- nosy: +martin.panter, serhiy.storchaka ___ Python tracker

[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-15 Thread STINNER Victor
New submission from STINNER Victor: Attached patch is avoids a syscall in os.set_inheritable() if the FD_CLOEXEC flag is already set/cleared. The change only impacts platforms using fcntl() in _Py_set_inheritable(). Windows has a different implementation, and Linux uses ioctl() for example.