From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1356 invoked by alias); 2 Jan 2018 05:46:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 1343 invoked by uid 89); 2 Jan 2018 05:46:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*u:6.0 X-HELO: mav.lukeshu.com Date: Tue, 02 Jan 2018 05:46:00 -0000 Message-ID: <878tdgx16y.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: libc-alpha@sourceware.org Subject: Re: [PATCH v2] tst-ttyname: skip the test when /dev/ptmx is not available In-Reply-To: <20171225214154.GB11045@altlinux.org> References: <20171225214154.GB11045@altlinux.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-01/txt/msg00072.txt.bz2 On Mon, 25 Dec 2017 16:41:54 -0500, Dmitry V. Levin wrote: > > * 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. > --- > ChangeLog | 5 +++++ > sysdeps/unix/sysv/linux/tst-ttyname.c | 9 ++++++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/unix/sysv/linux/tst-ttyname.c b/sysdeps/unix/sysv/linux/tst-ttyname.c > index 0fdf1a8..6848a6d 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) > -- > ldv As I explained in a different thread: I generally support applying this and backporting it to the 2.26 release branch. However, shouldn't it also make this same change in do_in_chroot_2? Of course, if do_in_chroot_1 returns EXIT_UNSUPPORTED, then do_in_chroot_2 doesn't get to run. But, as I think about that more, I don't think that's the correct thing to do. Maybe also do this? @@ -557,12 +571,7 @@ do_test (void) support_become_root (); int ret1 = do_in_chroot_1 (run_chroot_tests); - if (ret1 == EXIT_UNSUPPORTED) - return ret1; - int ret2 = do_in_chroot_2 (run_chroot_tests); - if (ret2 == EXIT_UNSUPPORTED) - return ret2; return ret1 | ret2; -- Happy hacking, ~ Luke Shumaker