summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2006-01-29 00:02:57 +0000
committercognet <cognet@FreeBSD.org>2006-01-29 00:02:57 +0000
commit80e1881f9b4b11c886525a37824a8053eb51c1e7 (patch)
tree07caea236ddd71211e27e20791687f648da4270f /lib
parent252cbc497372b95563c8da2a5f384597fa6264c1 (diff)
downloadFreeBSD-src-80e1881f9b4b11c886525a37824a8053eb51c1e7.zip
FreeBSD-src-80e1881f9b4b11c886525a37824a8053eb51c1e7.tar.gz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/grantpt.c9
1 files changed, 7 insertions, 2 deletions
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);
}
OpenPOWER on IntegriCloud