mirror of
https://github.com/python/cpython.git
synced 2025-10-28 09:10:36 +00:00
Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
This commit is contained in:
commit
162fee109b
4 changed files with 86 additions and 4 deletions
|
|
@ -111,7 +111,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);
|
||||
|
|
@ -154,7 +154,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