From 80e1881f9b4b11c886525a37824a8053eb51c1e7 Mon Sep 17 00:00:00 2001 From: cognet Date: Sun, 29 Jan 2006 00:02:57 +0000 Subject: 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 --- lib/libc/stdlib/grantpt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdlib/grantpt.c b/lib/libc/stdlib/grantpt.c index 26b8017..1f79211 100644 --- a/lib/libc/stdlib/grantpt.c +++ b/lib/libc/stdlib/grantpt.c @@ -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); } -- cgit v1.1