summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-08-23 17:48:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-08-23 17:48:34 (GMT)
commit162fee109b4469b8b2aec063f6225e19e83ae208 (patch)
tree813d3bf4a7d7c2d2ef432e0989d17b87d8b9144d /Modules/_multiprocessing
parent5fab03fd1565f4cd644ea2ab007876084dabfb8d (diff)
parentbcb39d484628f55ffc3205e9ddd0166093695e50 (diff)
downloadcpython-162fee109b4469b8b2aec063f6225e19e83ae208.zip
cpython-162fee109b4469b8b2aec063f6225e19e83ae208.tar.gz
cpython-162fee109b4469b8b2aec063f6225e19e83ae208.tar.bz2
Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r--Modules/_multiprocessing/multiprocessing.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index 5d1cf56..1987b95 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -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);
}