Kaydet (Commit) f09994e5 authored tarafından Alex Martelli's avatar Alex Martelli

fixed wrong error checking on fcntl call as per SF bug # 821896

(same as commit of Sun Nov 2 to the release23-maint branch)
üst 0c5b4ad8
......@@ -47,8 +47,9 @@ except (ImportError, AttributeError):
pass
else:
def _set_cloexec(fd):
flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
if flags >= 0:
try: flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
except IOError: pass
else:
# flags read successfully, modify
flags |= _fcntl.FD_CLOEXEC
_fcntl.fcntl(fd, _fcntl.F_SETFD, flags)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment