From de42934deda9017618d688665f907c7ba3413414 Mon Sep 17 00:00:00 2001 From: Frank Benkstein Date: Tue, 24 Jul 2007 10:37:54 +0200 Subject: [PATCH] it is wrong to use /dev/console, use /dev/tty0 instead --- vlock-grab.c | 3 ++- vlock-lockswitch.c | 4 +++- vlock-unlockswitch.c | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/vlock-grab.c b/vlock-grab.c index be60d4d..75a9f64 100644 --- a/vlock-grab.c +++ b/vlock-grab.c @@ -20,6 +20,7 @@ #include #define VTNAME "/dev/tty%d" +#define CONSOLE "/dev/tty0" /* Grab a new console and run the program given by argv+1 there. Console * switching is locked as long as the program is running. When the program @@ -52,7 +53,7 @@ int main(int argc, char **argv) { /* XXX: add optional PAM check here */ /* open the virtual console directly */ - if ((consfd = open("/dev/console", O_RDWR)) < 0) { + if ((consfd = open(CONSOLE, O_RDWR)) < 0) { perror("vlock: cannot open virtual console"); exit (1); } diff --git a/vlock-lockswitch.c b/vlock-lockswitch.c index 3775eac..c3291f2 100644 --- a/vlock-lockswitch.c +++ b/vlock-lockswitch.c @@ -19,10 +19,12 @@ #include #include +#define CONSOLE "/dev/tty0" + int main(void) { int consfd; - if ((consfd = open("/dev/console", O_RDWR)) < 0) { + if ((consfd = open(CONSOLE, O_RDWR)) < 0) { perror("vlock: cannot open virtual console"); exit (1); } diff --git a/vlock-unlockswitch.c b/vlock-unlockswitch.c index 626c0a0..37912b3 100644 --- a/vlock-unlockswitch.c +++ b/vlock-unlockswitch.c @@ -19,10 +19,12 @@ #include #include +#define CONSOLE "/dev/tty0" + int main(void) { int consfd; - if ((consfd = open("/dev/console", O_RDWR)) < 0) { + if ((consfd = open(CONSOLE, O_RDWR)) < 0) { perror("vlock: cannot open virtual console"); exit (1); } -- 2.11.4.GIT