summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-05-29 00:16:08 -0400
committerRay Strode <rstrode@redhat.com>2008-05-29 00:16:08 -0400
commit93ac9f7b1c1d605e313f91cc2eb9324a7b71ba1f (patch)
tree4f9b4091c39e425948ade8cc61ec4c9f50cc8cf6 /src
parentdd3e2229d73f1f264cb07aab4765196307ac9e97 (diff)
downloadplymouth-93ac9f7b1c1d605e313f91cc2eb9324a7b71ba1f.tar.gz
plymouth-93ac9f7b1c1d605e313f91cc2eb9324a7b71ba1f.tar.xz
plymouth-93ac9f7b1c1d605e313f91cc2eb9324a7b71ba1f.zip
Set up event loop exit handler in plugins on show success
Previously we were setting up the exit handler at the top of the show vtable function. This meant having to remove the exit handler if the show fails. It's much easier to not set up the handler until after we know we're going to succeed.
Diffstat (limited to 'src')
-rw-r--r--src/splash-plugins/fade-in/plugin.c13
-rw-r--r--src/splash-plugins/spinfinity/plugin.c14
2 files changed, 9 insertions, 18 deletions
diff --git a/src/splash-plugins/fade-in/plugin.c b/src/splash-plugins/fade-in/plugin.c
index 4540413..1056fd4 100644
--- a/src/splash-plugins/fade-in/plugin.c
+++ b/src/splash-plugins/fade-in/plugin.c
@@ -423,9 +423,6 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
on_enter, plugin);
plugin->loop = loop;
- ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
- detach_from_event_loop,
- plugin);
ply_trace ("loading logo image");
if (!ply_image_load (plugin->logo_image))
@@ -449,18 +446,16 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_trace ("opening frame buffer");
if (!ply_frame_buffer_open (plugin->frame_buffer))
- {
- ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
- detach_from_event_loop,
- plugin);
- return false;
- }
+ return false;
plugin->window = window;
if (!ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_GRAPHICS))
return false;
+ ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
+ detach_from_event_loop,
+ plugin);
ply_event_loop_watch_signal (plugin->loop,
SIGINT,
(ply_event_handler_t)
diff --git a/src/splash-plugins/spinfinity/plugin.c b/src/splash-plugins/spinfinity/plugin.c
index 62701b3..84dfa50 100644
--- a/src/splash-plugins/spinfinity/plugin.c
+++ b/src/splash-plugins/spinfinity/plugin.c
@@ -301,9 +301,6 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
on_enter, plugin);
plugin->loop = loop;
- ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
- detach_from_event_loop,
- plugin);
ply_trace ("loading logo image");
if (!ply_image_load (plugin->logo_image))
@@ -327,18 +324,17 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_trace ("opening frame buffer");
if (!ply_frame_buffer_open (plugin->frame_buffer))
- {
- ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
- detach_from_event_loop,
- plugin);
- return false;
- }
+ return false;
plugin->window = window;
if (!ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_GRAPHICS))
return false;
+ ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
+ detach_from_event_loop,
+ plugin);
+
ply_event_loop_watch_signal (plugin->loop,
SIGINT,
(ply_event_handler_t)