mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
This commit is contained in:
parent
46e1ce214b
commit
daf455554b
51 changed files with 1448 additions and 317 deletions
|
|
@ -115,7 +115,9 @@ newossobject(PyObject *arg)
|
|||
one open at a time. This does *not* affect later I/O; OSS
|
||||
provides a special ioctl() for non-blocking read/write, which is
|
||||
exposed via oss_nonblock() below. */
|
||||
if ((fd = open(devicename, imode|O_NONBLOCK)) == -1) {
|
||||
fd = _Py_open(devicename, imode|O_NONBLOCK);
|
||||
|
||||
if (fd == -1) {
|
||||
PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -177,7 +179,8 @@ newossmixerobject(PyObject *arg)
|
|||
devicename = "/dev/mixer";
|
||||
}
|
||||
|
||||
if ((fd = open(devicename, O_RDWR)) == -1) {
|
||||
fd = _Py_open(devicename, O_RDWR);
|
||||
if (fd == -1) {
|
||||
PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue