summaryrefslogtreecommitdiff
path: root/src/vconsole
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-01-15 20:32:57 +0100
committerKay Sievers <kay@vrfy.org>2013-01-15 20:40:53 +0100
commit10ffbc99afed12bd59bcf91d8242ea65b04eec40 (patch)
tree52db0ed8d6c03dd0a19aa42dd45150375f10627d /src/vconsole
parentb02a01dc08317e961545521359f963752bd2c206 (diff)
vconsole: use /dev/vcsa1-15 to check for allocated VTs
Diffstat (limited to 'src/vconsole')
-rw-r--r--src/vconsole/vconsole-setup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 679dc1aafb..65017055f3 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -183,11 +183,12 @@ static void font_copy_to_all_vcs(int fd) {
if (i == vcs.v_active)
continue;
- /* skip unused VTs above tty6 to avoid allocating them */
- if (i > 6 && ((vcs.v_state >> i) & 1) == 0)
+ /* skip non-allocated ttys */
+ snprintf(vcname, sizeof(vcname), "/dev/vcs%i", i);
+ if (access(vcname, F_OK) < 0)
continue;
- snprintf(vcname , sizeof(vcname), "/dev/tty%i", i);
+ snprintf(vcname, sizeof(vcname), "/dev/tty%i", i);
vcfd = open_terminal(vcname, O_RDWR|O_CLOEXEC);
if (vcfd < 0)
continue;