[mutter] Make plugin loading failure fatal



commit 1133a4ff9ce5e4553a4f550419778bc5ed3f6309
Author: Colin Walters <walters verbum org>
Date:   Thu Feb 3 12:51:35 2011 -0500

    Make plugin loading failure fatal
    
    If a plugin was explicitly specified, falling back to the default
    silently is bad; a manager component like gnome-session can
    do a better job of handling this scenario.
    
    An example we've hit in gnome-shell is where SpiderMonkey changes
    without gjs being rebuilt, and loading the plugin fails due to
    unresolved symbols.
    
    But there are obviously others, like the file being missing or
    corrupt.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641384

 src/compositor/meta-plugin-manager.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index 8634949..15d340b 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -31,6 +31,7 @@
 #include "../core/window-private.h"
 
 #include <string.h>
+#include <stdlib.h>
 
 #include <clutter/x11/clutter-x11.h>
 
@@ -281,8 +282,15 @@ meta_plugin_manager_load (MetaPluginManager *plugin_mgr)
                 }
             }
           else
-            g_warning ("Unable to load plugin module [%s]: %s",
-                       path, g_module_error());
+            {
+              /* This is fatal under the assumption that a monitoring
+               * process like gnome-session will take over and handle
+               * our untimely exit.
+               */
+              g_printerr ("Unable to load plugin module [%s]: %s",
+                          path, g_module_error());
+              exit (1);
+            }
 
           g_free (path);
           g_free (plugin_string);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]