aboutsummaryrefslogtreecommitdiffstats
path: root/vt.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-03-24 11:35:51 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-03-24 11:35:51 +0100
commit7e1cb7262703c8d873b3838aaf4b5083716b5065 (patch)
tree0630c25626b6e7e45f511d4fc99c9896ec91f026 /vt.c
parent5e68ede72c48aeae3412e31e5633c03d48048deb (diff)
downloadfbida-7e1cb7262703c8d873b3838aaf4b5083716b5065.tar.gz
gfx init and console switching tweaks
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/vt.c b/vt.c
index da77813..f15d51f 100644
--- a/vt.c
+++ b/vt.c
@@ -77,30 +77,31 @@ int console_switch_init(void (*redraw)(void))
sigaction(SIGUSR1,&act,&old);
sigaction(SIGUSR2,&act,&old);
+ if (-1 == ioctl(STDIN_FILENO, VT_GETMODE, &vt_omode)) {
+ perror("ioctl VT_GETMODE");
+ return -1;
+ }
+ if (-1 == ioctl(STDIN_FILENO, KDGETMODE, &kd_mode)) {
+ perror("ioctl KDGETMODE");
+ return -1;
+ }
+
if (-1 == ioctl(STDIN_FILENO, VT_GETMODE, &vt_mode)) {
perror("ioctl VT_GETMODE");
- exit(1);
+ return -1;
}
vt_mode.mode = VT_PROCESS;
vt_mode.waitv = 0;
vt_mode.relsig = SIGUSR1;
vt_mode.acqsig = SIGUSR2;
-
- if (-1 == ioctl(STDIN_FILENO, VT_GETMODE, &vt_omode)) {
- perror("ioctl VT_GETMODE");
- exit(1);
- }
if (-1 == ioctl(STDIN_FILENO, VT_SETMODE, &vt_mode)) {
perror("ioctl VT_SETMODE");
- exit(1);
- }
- if (-1 == ioctl(STDIN_FILENO, KDGETMODE, &kd_mode)) {
- perror("ioctl KDGETMODE");
- exit(1);
+ return -1;
}
if (-1 == ioctl(STDIN_FILENO, KDSETMODE, KD_GRAPHICS)) {
+ ioctl(STDIN_FILENO, VT_SETMODE, &vt_omode);
perror("ioctl KDSETMODE");
- exit(1);
+ return -1;
}
console_switching_active = true;
return 0;