X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpython.c;h=9d47d701ce1e5154c6d65b7b55dee4b854412507;hb=25824c65721f0f21cadf1607fad367c7e7831816;hp=64db6985ad4fa301663058c935794c9c73ba8a3a;hpb=063e81d76677a3b52c5d8a1fbfbdf2bf87a75cee;p=collectd.git diff --git a/src/python.c b/src/python.c index 64db6985..9d47d701 100644 --- a/src/python.c +++ b/src/python.c @@ -31,7 +31,7 @@ #include "collectd.h" -#include "common.h" +#include "utils/common/common.h" #include "cpython.h" @@ -367,7 +367,7 @@ void cpy_log_exception(const char *context) { continue; if (cpy[strlen(cpy) - 1] == '\n') - cpy[strlen(cpy) - 1] = 0; + cpy[strlen(cpy) - 1] = '\0'; Py_BEGIN_ALLOW_THREADS; ERROR("%s", cpy); @@ -1133,7 +1133,11 @@ static void *cpy_interactive(void *pipefd) { cpy_log_exception("interactive session init"); } cur_sig = PyOS_setsig(SIGINT, python_sigint_handler); +#if PY_VERSION_HEX < 0x03070000 PyOS_AfterFork(); +#else + PyOS_AfterFork_Child(); +#endif PyEval_InitThreads(); close(*(int *)pipefd); PyRun_InteractiveLoop(stdin, "");