mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
This commit is contained in:
parent
5bd8b8d80f
commit
bcb39d4846
3 changed files with 86 additions and 3 deletions
|
@ -122,7 +122,7 @@ multiprocessing_sendfd(PyObject *self, PyObject *args)
|
|||
cmsg->cmsg_type = SCM_RIGHTS;
|
||||
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
|
||||
msg.msg_controllen = cmsg->cmsg_len;
|
||||
*CMSG_DATA(cmsg) = fd;
|
||||
* (int *) CMSG_DATA(cmsg) = fd;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
res = sendmsg(conn, &msg, 0);
|
||||
|
@ -165,7 +165,7 @@ multiprocessing_recvfd(PyObject *self, PyObject *args)
|
|||
if (res < 0)
|
||||
return PyErr_SetFromErrno(PyExc_OSError);
|
||||
|
||||
fd = *CMSG_DATA(cmsg);
|
||||
fd = * (int *) CMSG_DATA(cmsg);
|
||||
return Py_BuildValue("i", fd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue