From: notaz Date: Mon, 31 May 2010 22:18:25 +0000 (+0000) Subject: oshide: drop termios dump/restore, OS already handles that X-Git-Tag: v1.85~182 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=234f07f4a415f488fe890de2be9e994d9a9da17c;p=picodrive.git oshide: drop termios dump/restore, OS already handles that git-svn-id: file:///home/notaz/opt/svn/PicoDrive@875 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/platform/linux/oshide.c b/platform/linux/oshide.c index e66aaaee..881fcb77 100644 --- a/platform/linux/oshide.c +++ b/platform/linux/oshide.c @@ -15,7 +15,6 @@ #include #define PFX "oshide: " -#define TERMIOS_DUMP_FILE "/tmp/pico_tios" #define FPTR(f) typeof(f) * p##f #define FPTR_LINK(xf, dl, f) { \ @@ -169,7 +168,6 @@ static int g_kbdfd; static void hidecon_start(void) { struct termios kbd_termios; - FILE *tios_f; int mode; g_kbdfd = open("/dev/tty", O_RDWR); @@ -188,14 +186,6 @@ static void hidecon_start(void) goto fail; } - /* dump for picorestore */ - g_kbd_termios_saved = kbd_termios; - tios_f = fopen(TERMIOS_DUMP_FILE, "wb"); - if (tios_f) { - fwrite(&kbd_termios, sizeof(kbd_termios), 1, tios_f); - fclose(tios_f); - } - kbd_termios.c_lflag &= ~(ICANON | ECHO); // | ISIG); kbd_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON); kbd_termios.c_cc[VMIN] = 0; @@ -230,8 +220,6 @@ static void hidecon_end(void) if (tcsetattr(g_kbdfd, TCSAFLUSH, &g_kbd_termios_saved) == -1) perror(PFX "tcsetattr"); - remove(TERMIOS_DUMP_FILE); - close(g_kbdfd); g_kbdfd = -1; } diff --git a/platform/pandora/picorestore.c b/platform/pandora/picorestore.c index 6a327552..a278abc3 100644 --- a/platform/pandora/picorestore.c +++ b/platform/pandora/picorestore.c @@ -5,15 +5,12 @@ #include #include #include -#include #include int main() { struct fb_var_screeninfo fbvar; - struct termios kbd_termios; int ret, fbdev, kbdfd; - FILE *tios_f; fbdev = open("/dev/fb0", O_RDWR); if (fbdev == -1) { @@ -40,28 +37,16 @@ int main() end_fb: close(fbdev); - tios_f = fopen("/tmp/pico_tios", "rb"); - if (tios_f != NULL) { - kbdfd = open("/dev/tty", O_RDWR); - if (kbdfd == -1) { - perror("open /dev/tty"); - return 1; - } - - if (fread(&kbd_termios, sizeof(kbd_termios), 1, tios_f) == 1) { - if (ioctl(kbdfd, KDSETMODE, KD_TEXT) == -1) - perror("KDSETMODE KD_TEXT"); + kbdfd = open("/dev/tty", O_RDWR); + if (kbdfd == -1) { + perror("open /dev/tty"); + return 1; + } - printf("restoring termios.. "); - if (tcsetattr(kbdfd, TCSAFLUSH, &kbd_termios) == -1) - perror("tcsetattr"); - else - printf("ok\n"); - } + if (ioctl(kbdfd, KDSETMODE, KD_TEXT) == -1) + perror("KDSETMODE KD_TEXT"); - close(kbdfd); - fclose(tios_f); - } + close(kbdfd); return 0; }