mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 07:13:42 +00:00
python-lxc: Call PyOS_AfterFork after attaching to a container
As lxc_attach() calls fork() PyOS_AfterFork should be called in the new process if the Python interpreter will continue to be used. Signed-off-by: Danil Osherov <shindo@yandex-team.ru>
This commit is contained in:
parent
364d54c9f0
commit
4027875db1
@ -117,6 +117,12 @@ struct lxc_attach_python_payload {
|
||||
|
||||
static int lxc_attach_python_exec(void* _payload)
|
||||
{
|
||||
/* This function is the first one to be called after attaching to a
|
||||
* container. As lxc_attach() calls fork() PyOS_AfterFork should be called
|
||||
* in the new process if the Python interpreter will continue to be used.
|
||||
*/
|
||||
PyOS_AfterFork();
|
||||
|
||||
struct lxc_attach_python_payload *payload =
|
||||
(struct lxc_attach_python_payload *)_payload;
|
||||
PyObject *result = PyObject_CallFunctionObjArgs(payload->fn,
|
||||
|
Loading…
Reference in New Issue
Block a user