Skip to contentSkip to conversation

plugin python: Adjust the handling after PyRun_String() failed

PATCH In review Taeung Song 2 participants 2 messages Apr 27, 2017 – Jan 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 plugin python: Adjust the handling after PyRun_String() failed

Even though PyRun_String() failed,
just 0 will be returned but we need to return -1
that means error status, so fix it.

---
 plugin_python.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
plugin_python.c +1 -1
index 2997679..c283ed7 100644
@@ -55,7 +55,7 @@ static int load_plugin(struct pevent *pevent, const char *path,
 
 	free(load);
 
-	return 0;
+	return res ? 0 : -1;
 }
 
 int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · On Thu, 27 Apr 2017 11:55:58 +0900 Taeung Song <[email protected]> wrote:

Even though PyRun_String() failed,
just 0 will be returned but we need to return -1
that means error status, so fix it.

Ug, I just noticed this patch floating in the flood of my INBOX.

I just applied it, and will be pushing it out soon.

Thanks, and I'm really sorry for not seeing it.

-- Steve

Quoted 19 lines
---
 plugin_python.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
plugin_python.c +1 -1
index 2997679..c283ed7 100644
@@ -55,7 +55,7 @@ static int load_plugin(struct pevent *pevent, const char *path,
 
 	free(load);
 
-	return 0;
+	return res ? 0 : -1;
 }
 
 int PEVENT_PLUGIN_LOADER(struct pevent *pevent)