From 1133a4ff9ce5e4553a4f550419778bc5ed3f6309 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 3 Feb 2011 12:51:35 -0500 Subject: [PATCH] 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 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c index 8634949cf..15d340b88 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 +#include #include @@ -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);