diff options
| author | Bill Nottingham <notting@redhat.com> | 2003-08-05 20:25:14 +0000 |
|---|---|---|
| committer | Bill Nottingham <notting@redhat.com> | 2003-08-05 20:25:14 +0000 |
| commit | 21abf2cfb4445453d421266dce65db9aea1b2479 (patch) | |
| tree | 46cbefbe6bf75b2a4a7611dffcb2cc4d9634b54d | |
| parent | fec20ab00e33e3f5cae0c219ef6ae8ab98fa7557 (diff) | |
don't return 'vt' on vioconsole (#90465)
| -rw-r--r-- | src/consoletype.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/consoletype.c b/src/consoletype.c index 1ce98901..40b20ab0 100644 --- a/src/consoletype.c +++ b/src/consoletype.c @@ -1,5 +1,7 @@ +#include <fcntl.h> #include <stdio.h> #include <string.h> +#include <unistd.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/sysmacros.h> @@ -19,8 +21,23 @@ int main(int argc, char **argv) type = "serial"; ret = 1; } else { +#ifdef __powerpc__ + int fd; + char buf[65536]; + + fd = open("/proc/tty/drivers",O_RDONLY); + read(fd, buf, 65535); + if (strstr(buf,"vioconsole /dev/tty")) { + type = "vio"; + ret = 3; + } else { + type = "vt"; + ret = 0; + } +#else type = "vt"; ret = 0; +#endif } } else { type = "pty"; |
