]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tst-ttyname: skip the test when /dev/ptmx is not available
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 25 Dec 2017 02:30:32 +0000 (02:30 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 8 Jan 2018 22:02:53 +0000 (22:02 +0000)
* 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.

(cherry picked from commit d7ff3f11b64a28273285d341f795217bbf18ac9c)

ChangeLog
sysdeps/unix/sysv/linux/tst-ttyname.c

index 929f846be8e37385fc36bb8871d7107bd44a1e2a..f9212518d4ce11fcb1dcab909ad3fe8f7614d600 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-08  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * 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.
+
 2017-12-29  Aurelien Jarno  <aurelien@aurel32.net>
 
        [BZ #22611]
index 0fdf1a8ccbb3bd331957f2232b32822f5d3ab758..6848a6d3e28ae4639237e8f97c0cc4806a3c6cbb 100644 (file)
@@ -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)