Fix vt(4) detection in kbdcontrol and vidcontrol
As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence of a vt(4) sysctl is not sufficient to determine that vt(4) is in use. Reported by: Trond Endrestøl
This commit is contained in:
parent
06ba451499
commit
25f9584271
@ -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 *
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user