return loop;
}
+ply_event_loop_t *
+ply_event_loop_get_default (void)
+{
+ static ply_event_loop_t *loop = NULL;
+
+ if (loop == NULL)
+ loop = ply_event_loop_new ();
+
+ return loop;
+}
+
static void
ply_event_loop_free_exit_closures (ply_event_loop_t *loop)
{
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
ply_event_loop_t *ply_event_loop_new (void);
void ply_event_loop_free (ply_event_loop_t *loop);
+ply_event_loop_t *ply_event_loop_get_default (void);
ply_fd_watch_t *ply_event_loop_watch_fd (ply_event_loop_t *loop,
int fd,
ply_event_loop_fd_status_t status,
state.command_parser = ply_command_parser_new ("plymouthd", "Boot splash control server");
- state.loop = ply_event_loop_new ();
+ state.loop = ply_event_loop_get_default ();
ply_command_parser_add_options (state.command_parser,
"help", "This help message", PLY_COMMAND_OPTION_TYPE_FLAG,
ply_buffer_free (state.boot_buffer);
ply_progress_free (state.progress);
- ply_trace ("freeing event loop");
- ply_event_loop_free (state.loop);
-
ply_trace ("exiting with code %d", exit_code);
if (debug_buffer != NULL)