public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] tst-ttyname: skip the test when /dev/ptmx is not available
@ 2017-12-25 11:48 Dmitry V. Levin
  2017-12-25 18:19 ` Florian Weimer
  0 siblings, 1 reply; 18+ messages in thread
From: Dmitry V. Levin @ 2017-12-25 11:48 UTC (permalink / raw)
  To: libc-alpha

* 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

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH v3] tst-ttyname: skip the test if failed to become root
@ 2017-12-26 14:10 Dmitry V. Levin
  0 siblings, 0 replies; 18+ messages in thread
From: Dmitry V. Levin @ 2017-12-26 14:10 UTC (permalink / raw)
  To: libc-alpha

* sysdeps/unix/sysv/linux/tst-ttyname.c (do_test): Skip the test
if support_become_root failed.
---
 ChangeLog                             | 5 +++++
 sysdeps/unix/sysv/linux/tst-ttyname.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/tst-ttyname.c b/sysdeps/unix/sysv/linux/tst-ttyname.c
index 0fdf1a8..3943403 100644
--- a/sysdeps/unix/sysv/linux/tst-ttyname.c
+++ b/sysdeps/unix/sysv/linux/tst-ttyname.c
@@ -554,7 +554,8 @@ run_chroot_tests (const char *slavename, int slave)
 static int
 do_test (void)
 {
-  support_become_root ();
+  if (!support_become_root ())
+    return EXIT_UNSUPPORTED;
 
   int ret1 = do_in_chroot_1 (run_chroot_tests);
   if (ret1 == EXIT_UNSUPPORTED)
-- 
ldv

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-01-02  5:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-25 11:48 [PATCH] tst-ttyname: skip the test when /dev/ptmx is not available Dmitry V. Levin
2017-12-25 18:19 ` Florian Weimer
2017-12-25 19:13   ` Dmitry V. Levin
2017-12-25 20:10     ` Zack Weinberg
2017-12-25 21:01       ` Dmitry V. Levin
2017-12-25 21:19         ` Zack Weinberg
2017-12-25 21:39           ` Dmitry V. Levin
2017-12-26 13:07         ` Florian Weimer
2017-12-26 13:53           ` Dmitry V. Levin
2017-12-26 23:07             ` Dmitry V. Levin
2018-01-01  1:30               ` Joseph Myers
2018-01-01  2:28                 ` Luke Shumaker
2017-12-29 14:20             ` Florian Weimer
2017-12-29 14:49               ` Dmitry V. Levin
2018-01-02  5:19               ` [PATCH v3] tst-ttyname: skip the test if failed to become root Luke Shumaker
2017-12-30 23:09           ` Luke Shumaker
2017-12-31  0:11             ` Dmitry V. Levin
2017-12-26 14:10 Dmitry V. Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).