If the sysctl kern.pts.enable doesn't exist, check that /dev/ptmx is there,

and if so, use the pts system.

Suggested by:	rwatson
This commit is contained in:
Olivier Houchard 2006-01-29 00:02:57 +00:00
parent 5276d7471f
commit 9b1fa2482e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154965

View file

@ -100,8 +100,13 @@ __use_pts(void)
len = sizeof(use_pts);
error = sysctlbyname("kern.pts.enable", &use_pts, &len, NULL, 0);
if (error)
return (0);
if (error) {
struct stat sb;
if (stat("/dev/ptmx", &sb) != 0)
return (0);
use_pts = 1;
}
return (use_pts);
}