diff options
author | Federico Vaga <federico.vaga@vaga.pv.it> | 2017-04-23 12:22:54 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-04-26 10:49:42 -0400 |
commit | 3b43d0a77d7178b797d6ba38ca21b8286b647afd (patch) | |
tree | f599a21bdc62d30a730e1dca83d36a52287f8842 | |
parent | 83c1851afdd413e7e81b93333992f1127a558ffc (diff) | |
download | trace-cmd-3b43d0a77d7178b797d6ba38ca21b8286b647afd.tar.gz |
plugin:python: fix compiler warning
The function `load_plugin` is passed, as argument, to
`trace_util_load_plugins()` but the prototype was not exactly the same.
Link: http://lkml.kernel.org/r/20170423102258.21609-2-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | plugin_python.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugin_python.c b/plugin_python.c index da07d27d..d3da8b08 100644 --- a/plugin_python.c +++ b/plugin_python.c @@ -20,7 +20,7 @@ static const char pyload[] = "finally:\n" " file.close()\n"; -static void load_plugin(struct pevent *pevent, const char *path, +static int load_plugin(struct pevent *pevent, const char *path, const char *name, void *data) { PyObject *globals = data; @@ -32,7 +32,7 @@ static void load_plugin(struct pevent *pevent, const char *path, PyObject *res; if (!full || !n) - return; + return -ENOMEM; strcpy(full, path); strcat(full, "/"); @@ -43,7 +43,7 @@ static void load_plugin(struct pevent *pevent, const char *path, asprintf(&load, pyload, full, n); if (!load) - return; + return -ENOMEM; res = PyRun_String(load, Py_file_input, globals, globals); if (!res) { @@ -53,6 +53,8 @@ static void load_plugin(struct pevent *pevent, const char *path, Py_DECREF(res); free(load); + + return 0; } int PEVENT_PLUGIN_LOADER(struct pevent *pevent) |