mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-07 15:28:12 +02:00
change the event loop test to quit after a 5 second alarm
This commit is contained in:
parent
5b416dbb9d
commit
2224329fdd
1 changed files with 11 additions and 0 deletions
|
|
@ -1059,6 +1059,13 @@ ply_event_loop_run (ply_event_loop_t *loop)
|
|||
|
||||
static ply_event_loop_t *loop;
|
||||
|
||||
static void
|
||||
alrm_signal_handler (void)
|
||||
{
|
||||
write (1, "times up!\n", sizeof ("times up!\n") - 1);
|
||||
ply_event_loop_exit (loop, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
usr1_signal_handler (void)
|
||||
{
|
||||
|
|
@ -1106,12 +1113,16 @@ main (int argc,
|
|||
ply_event_loop_watch_signal (loop, SIGUSR1,
|
||||
(ply_event_handler_t)
|
||||
usr1_signal_handler, NULL);
|
||||
ply_event_loop_watch_signal (loop, SIGALRM,
|
||||
(ply_event_handler_t)
|
||||
alrm_signal_handler, NULL);
|
||||
|
||||
ply_event_loop_watch_fd (loop, 0, PLY_EVENT_LOOP_FD_STATUS_HAS_DATA,
|
||||
(ply_event_handler_t) line_received_handler,
|
||||
(ply_event_handler_t) line_received_handler,
|
||||
NULL);
|
||||
|
||||
alarm (5);
|
||||
exit_code = ply_event_loop_run (loop);
|
||||
|
||||
ply_event_loop_free (loop);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue