From 0f23d50c8291b23799e55c8653c15f16c0d752d0 Mon Sep 17 00:00:00 2001 From: pk33 Date: Sun, 3 Nov 2024 03:41:54 +0100 Subject: VT switcher fix --- src/display.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/display.c') diff --git a/src/display.c b/src/display.c index 1e68f89..25c6437 100644 --- a/src/display.c +++ b/src/display.c @@ -52,7 +52,7 @@ typedef struct { static DRMData_d drmData = {0,}; -static Size vtPipe[2] = { -1, -1 }; +static int vtPipe[2] = { -1, -1 }; static struct termios termOldConfig; @@ -538,11 +538,10 @@ static Size _init_vt_switch( void ) struct vt_mode vt_mode = {0,}; sigset_t set; - __display.ttyfd = -1; + __display.ttyfd = -1; - /* Init VT pipes */ - if (pipe(vtPipe) != 0) + if( pipe(vtPipe) == -1 ) { vtPipe[0] = vtPipe[1] = -1; loge( "Could not set VT pipes"); @@ -557,7 +556,6 @@ static Size _init_vt_switch( void ) loge( "Could not set VT write pipe" ); return E33_EXIT_FAILURE; } - /**/ if( __display.ttyfd = open("/dev/tty", O_RDWR ) < 0 ) { @@ -566,7 +564,6 @@ static Size _init_vt_switch( void ) } - /* Setup signals */ if( _has_signal(REL_SIGNAL) ) { loge( "VT release signal is already in use"); return E33_EXIT_FAILURE; @@ -584,8 +581,6 @@ static Size _init_vt_switch( void ) loge( "Could not set acquire signal handler"); return E33_EXIT_FAILURE; } - /**/ - if( ioctl(__display.ttyfd, VT_GETMODE, &vt_mode) < 0 ) { -- cgit v1.2.3