diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index d38eda091357..0f927ef3cf03 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -146,11 +146,12 @@ static void usage(void) __dead2; static int is_vt4(void) { + char vty_name[4] = ""; + size_t len = sizeof(vty_name); - if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0) - return (1); - - return (0); + if (sysctlbyname("kern.vty", vty_name, &len, NULL, 0) != 0) + return (0); + return (strcmp(vty_name, "vt") == 0); } static char * diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c index 2096e2abcbb6..32e4de64fbe6 100644 --- a/usr.sbin/vidcontrol/vidcontrol.c +++ b/usr.sbin/vidcontrol/vidcontrol.c @@ -216,11 +216,12 @@ usage(void) static int is_vt4(void) { + char vty_name[4] = ""; + size_t len = sizeof(vty_name); - if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0) - return (1); - - return (0); + if (sysctlbyname("kern.vty", vty_name, &len, NULL, 0) != 0) + return (0); + return (strcmp(vty_name, "vt") == 0); } /*