commit d900f0c
Michael Forney
·
2013-11-23 01:27:14 +0000 UTC
parent 295909f
launch: Check if opening tty0 succeeded
1 files changed,
+5,
-0
+5,
-0
1@@ -295,8 +295,13 @@ static int find_vt()
2 }
3
4 tty0_fd = open("/dev/tty0", O_RDWR);
5+
6+ if (tty0_fd == -1)
7+ die("Could not open /dev/tty0 to find open VT");
8+
9 if (ioctl(tty0_fd, VT_OPENQRY, &vt) != 0)
10 die("Could not find open VT");
11+
12 close(tty0_fd);
13
14 fprintf(stderr, "Running on VT %d\n", vt);