summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-08-23 13:00:38 (GMT)
committerGitHub <noreply@github.com>2019-08-23 13:00:38 (GMT)
commitc3642219090f2564c1790330cbf0ba31f19dcaf4 (patch)
tree1f7676053b2ef5bdd06a52c9fa1734b73e7d97a9 /Modules
parent3b26f734c0c96d267f23f59b42fcbb193fbf146b (diff)
downloadcpython-c3642219090f2564c1790330cbf0ba31f19dcaf4.zip
cpython-c3642219090f2564c1790330cbf0ba31f19dcaf4.tar.gz
cpython-c3642219090f2564c1790330cbf0ba31f19dcaf4.tar.bz2
bpo-34521: Fix FD transfer in multiprocessing on FreeBSD (GH-15422)
Fix file descriptors transfer in multiprocessing on FreeBSD: use CMSG_SPACE() rather than CMSG_LEN(); see RFC 3542.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_multiprocessing/multiprocessing.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index d192a07..eecace8 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -167,7 +167,7 @@ multiprocessing_recvfd(PyObject *self, PyObject *args)
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
- cmsg->cmsg_len = CMSG_LEN(sizeof(int));
+ cmsg->cmsg_len = CMSG_SPACE(sizeof(int));
msg.msg_controllen = cmsg->cmsg_len;
Py_BEGIN_ALLOW_THREADS