diff options
Diffstat (limited to 'isys/lang.c')
-rw-r--r-- | isys/lang.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/isys/lang.c b/isys/lang.c index 177e02126..e85b8041f 100644 --- a/isys/lang.c +++ b/isys/lang.c @@ -82,6 +82,7 @@ int loadKeymap(gzFile stream) { int count = 0; int magic; short keymap[NR_KEYS]; + struct stat sb; #if defined (__s390__) || defined (__s390x__) return 0; @@ -89,6 +90,11 @@ int loadKeymap(gzFile stream) { if (isVioConsole()) return 0; + /* assume that if we're already on a pty loading a keymap is silly */ + fstat(0, &sb); + if (major(sb.st_rdev) == 3 || major(sb.st_rdev) == 136) + return 0; + if (gunzip_read(stream, &magic, sizeof(magic)) != sizeof(magic)) return -EIO; |