This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] tst-ttyname: skip the test when /dev/ptmx is not available
- From: "Dmitry V. Levin" <ldv at altlinux dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 25 Dec 2017 14:48:06 +0300
- Subject: [PATCH] tst-ttyname: skip the test when /dev/ptmx is not available
- Authentication-results: sourceware.org; auth=none
* sysdeps/unix/sysv/linux/tst-ttyname.c (do_in_chroot_1): Skip the
test instead of failing in case of an error returned by posix_openpt.
---
ChangeLog | 5 +++++
sysdeps/unix/sysv/linux/tst-ttyname.c | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/tst-ttyname.c b/sysdeps/unix/sysv/linux/tst-ttyname.c
index 0fdf1a8..15f6c4c 100644
--- a/sysdeps/unix/sysv/linux/tst-ttyname.c
+++ b/sysdeps/unix/sysv/linux/tst-ttyname.c
@@ -253,7 +253,9 @@ 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)
+ FAIL_UNSUPPORTED ("posix_openpt: %m");
VERIFY ((slavename = ptsname (master)));
VERIFY (unlockpt (master) == 0);
if (strncmp (slavename, "/dev/pts/", 9) != 0)
--
ldv