Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwife.git;a=commitdiff;h=9f7e46a588a7be2a639ba6d8f660a2ea19ee8d00

commit 9f7e46a588a7be2a639ba6d8f660a2ea19ee8d00
Author: Elentir <elen...@mailoo.org>
Date:   Tue Jul 14 22:15:38 2009 +0200

check return value of prerun functions

diff --git a/src/fwife.c b/src/fwife.c
index 70182be..5644f86 100644
--- a/src/fwife.c
+++ b/src/fwife.c
@@ -183,8 +183,14 @@ int plugin_next(GtkWidget *w, gpointer user_data)

/* load next plugin an call his prerun function */
plugin_active = g_list_nth_data(plugin_list, g_list_index(plugin_list, 
(gconstpointer)plugin_active)+1);
-       if(plugin_active->prerun)
-               plugin_active->prerun(&config);
+       if(plugin_active->prerun) {
+               if(plugin_active->prerun(&config) == -1) {
+                       LOG("Error when running plugin %s\n", 
plugin_active->name);
+                       fwife_error(_("Error when running plugin. Please 
report"));
+                       fwife_exit();
+                       return -1;
+               }
+       }
return 0;
}

@@ -194,8 +200,15 @@ int plugin_previous(GtkWidget *w, gpointer user_data)
plugin_active = g_list_nth_data(plugin_list, g_list_index(plugin_list, 
(gconstpointer)plugin_active)-1);

/* call prerun when back to a previous plugin */
-       if(plugin_active->prerun)
-               plugin_active->prerun(&config);
+       if(plugin_active->prerun) {
+               if(plugin_active->prerun(&config) == -1) {
+                       LOG("Error when running plugin %s\n", 
plugin_active->name);
+                       fwife_error(_("Error when running plugin. Please 
report"));
+                       fwife_exit();
+                       return -1;
+               }
+       }
+

return 0;
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to