[Xfce4-commits] <xfce4-panel:master> Properly handle exit status.

Nick Schermer noreply at xfce.org
Thu Mar 4 19:26:01 CET 2010


Updating branch refs/heads/master
         to b6421c95be7527e271c10c929d28eb3d502510cf (commit)
       from 24fcc04fd13d4c4c06adfcfaa8ca32ba53e70822 (commit)

commit b6421c95be7527e271c10c929d28eb3d502510cf
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Mar 4 19:21:44 2010 +0100

    Properly handle exit status.

 panel/panel-plugin-external-46.c |   14 ++++++++++++--
 panel/panel-plugin-external.c    |   14 ++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/panel/panel-plugin-external-46.c b/panel/panel-plugin-external-46.c
index 6adf309..451611d 100644
--- a/panel/panel-plugin-external-46.c
+++ b/panel/panel-plugin-external-46.c
@@ -792,14 +792,24 @@ panel_plugin_external_46_child_watch (GPid     pid,
       switch (WEXITSTATUS (status))
         {
         case PLUGIN_EXIT_SUCCESS:
+          break;
+
         case PLUGIN_EXIT_FAILURE:
         case PLUGIN_EXIT_PREINIT_FAILED:
         case PLUGIN_EXIT_CHECK_FAILED:
         case PLUGIN_EXIT_NO_PROVIDER:
-          /* wait until everything is settled, then destroy the
-           * external plugin so it is removed from the configuration */
+          panel_debug (PANEL_DEBUG_DOMAIN_EXTERNAL46,
+                       "Plugin exited with status %d. Removing from "
+                       "configuration.", WEXITSTATUS (status));
+
+          /* cleanup the plugin configuration (in panel-application) */
+          xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (external),
+                                                  PROVIDER_SIGNAL_REMOVE_PLUGIN);
+
+          /* wait until everything is settled */
           exo_gtk_object_destroy_later (GTK_OBJECT (external));
           break;
+
         }
     }
 
diff --git a/panel/panel-plugin-external.c b/panel/panel-plugin-external.c
index 154a80b..7f63b38 100644
--- a/panel/panel-plugin-external.c
+++ b/panel/panel-plugin-external.c
@@ -918,12 +918,22 @@ panel_plugin_external_child_watch (GPid     pid,
       switch (WEXITSTATUS (status))
         {
         case PLUGIN_EXIT_SUCCESS:
+          break;
+
         case PLUGIN_EXIT_FAILURE:
         case PLUGIN_EXIT_PREINIT_FAILED:
         case PLUGIN_EXIT_CHECK_FAILED:
         case PLUGIN_EXIT_NO_PROVIDER:
-          /* wait until everything is settled, then destroy the
-           * external plugin so it is removed from the configuration */
+          panel_debug (PANEL_DEBUG_DOMAIN_EXTERNAL,
+                       "Plugin exited with status %d. Removing from "
+                       "configuration.", WEXITSTATUS (status));
+
+          /* cleanup the plugin configuration (in panel-application) */
+          xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (external),
+                                                  PROVIDER_SIGNAL_REMOVE_PLUGIN);
+
+
+          /* wait until everything is settled */
           exo_gtk_object_destroy_later (GTK_OBJECT (external));
           break;
         }



More information about the Xfce4-commits mailing list