summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/grantpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/grantpt.c')
-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