mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 07:48:03 +02:00
return to text mode on crash
This commit is contained in:
parent
83a23fc456
commit
e77d7112d8
1 changed files with 18 additions and 0 deletions
18
src/main.c
18
src/main.c
|
|
@ -29,8 +29,11 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sysexits.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <linux/kd.h>
|
||||
|
||||
#include "ply-answer.h"
|
||||
#include "ply-boot-server.h"
|
||||
#include "ply-boot-splash.h"
|
||||
|
|
@ -385,6 +388,18 @@ initialize_environment (state_t *state)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
on_crash (int signal)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open ("/dev/tty7", O_RDWR | O_NOCTTY);
|
||||
|
||||
ioctl (fd, KDSETMODE, KD_TEXT);
|
||||
|
||||
close (fd);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
|
|
@ -423,6 +438,9 @@ main (int argc,
|
|||
return EX_UNAVAILABLE;
|
||||
}
|
||||
|
||||
signal (SIGABRT, on_crash);
|
||||
signal (SIGSEGV, on_crash);
|
||||
|
||||
state.loop = ply_event_loop_new ();
|
||||
|
||||
/* before do anything we need to make sure we have a working
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue