about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2017-12-25 02:30:32 +0000
committerDmitry V. Levin <ldv@altlinux.org>2018-01-08 22:02:53 +0000
commitd7ff3f11b64a28273285d341f795217bbf18ac9c (patch)
treed168efd834752a6850db76ed6d7abd671cef96b0 /sysdeps/unix/sysv/linux
parent401311cfba71b61d93d23aa17e5c9ac5fb047d48 (diff)
downloadglibc-d7ff3f11b64a28273285d341f795217bbf18ac9c.tar.gz
glibc-d7ff3f11b64a28273285d341f795217bbf18ac9c.tar.xz
glibc-d7ff3f11b64a28273285d341f795217bbf18ac9c.zip
tst-ttyname: skip the test when /dev/ptmx is not available
* sysdeps/unix/sysv/linux/tst-ttyname.c (do_in_chroot_1): Skip the
test instead of failing in case of ENOENT returned by posix_openpt.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/tst-ttyname.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-ttyname.c b/sysdeps/unix/sysv/linux/tst-ttyname.c
index 131570bf7b..35450e1c62 100644
--- a/sysdeps/unix/sysv/linux/tst-ttyname.c
+++ b/sysdeps/unix/sysv/linux/tst-ttyname.c
@@ -253,7 +253,14 @@ do_in_chroot_1 (int (*cb)(const char *, int))
   /* Open the PTS that we'll be testing on.  */
   int master;
   char *slavename;
-  VERIFY ((master = posix_openpt (O_RDWR|O_NOCTTY|O_NONBLOCK)) >= 0);
+  master = posix_openpt (O_RDWR|O_NOCTTY|O_NONBLOCK);
+  if (master < 0)
+    {
+      if (errno == ENOENT)
+	FAIL_UNSUPPORTED ("posix_openpt: %m");
+      else
+	FAIL_EXIT1 ("posix_openpt: %m");
+    }
   VERIFY ((slavename = ptsname (master)));
   VERIFY (unlockpt (master) == 0);
   if (strncmp (slavename, "/dev/pts/", 9) != 0)