aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-08-05 20:24:45 +0000
committerBill Nottingham <notting@redhat.com>2003-08-05 20:24:45 +0000
commitca1394c88821071465f7123000939f4ede4e0198 (patch)
tree7e7de33377ef66676d2a95f6bf8d956e18690fa3 /src
parent9d87ea5b47b46f556827aff9ce62d05f51950a7b (diff)
downloadinitscripts-ca1394c88821071465f7123000939f4ede4e0198.tar
initscripts-ca1394c88821071465f7123000939f4ede4e0198.tar.gz
initscripts-ca1394c88821071465f7123000939f4ede4e0198.tar.bz2
initscripts-ca1394c88821071465f7123000939f4ede4e0198.tar.xz
initscripts-ca1394c88821071465f7123000939f4ede4e0198.zip
don't return 'vt' on vioconsole (#90465)
Diffstat (limited to 'src')
-rw-r--r--src/consoletype.c17
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";