fixed wrong error checking on fcntl call as per SF bug # 821896
(same as commit of Sun Nov 2 to the release23-maint branch)
This commit is contained in:
parent
0c5b4ad8f2
commit
f09994e527
@ -47,8 +47,9 @@ except (ImportError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
def _set_cloexec(fd):
|
def _set_cloexec(fd):
|
||||||
flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
|
try: flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
|
||||||
if flags >= 0:
|
except IOError: pass
|
||||||
|
else:
|
||||||
# flags read successfully, modify
|
# flags read successfully, modify
|
||||||
flags |= _fcntl.FD_CLOEXEC
|
flags |= _fcntl.FD_CLOEXEC
|
||||||
_fcntl.fcntl(fd, _fcntl.F_SETFD, flags)
|
_fcntl.fcntl(fd, _fcntl.F_SETFD, flags)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user