summary refs log tree commit diff
path: root/login/programs/pt_chown.c
diff options
context:
space:
mode:
Diffstat (limited to 'login/programs/pt_chown.c')
-rw-r--r--login/programs/pt_chown.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/login/programs/pt_chown.c b/login/programs/pt_chown.c
index faec86b549..0205364748 100644
--- a/login/programs/pt_chown.c
+++ b/login/programs/pt_chown.c
@@ -109,7 +109,13 @@ do_pt_chown (void)
 
   /* Check that the returned slave pseudo terminal is a
      character device.  */
-  if (stat (pty, &st) < 0 || !S_ISCHR(st.st_mode))
+  if (stat (pty, &st) < 0
+#ifdef unix98_pseudo_p
+      || ! unix98_pseudo_p (st.st_rdev)
+#else
+      || !S_ISCHR(st.st_mode)
+#endif
+      )
     return FAIL_EINVAL;
 
   /* Get the group ID of the special `tty' group.  */