This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] tst-ttyname: skip the test when /dev/ptmx is not available
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: libc-alpha at sourceware dot org
- Date: Mon, 08 Jan 2018 18:47:49 +0100
- Subject: Re: [PATCH v2] tst-ttyname: skip the test when /dev/ptmx is not available
- Authentication-results: sourceware.org; auth=none
- References: <20171225214154.GB11045@altlinux.org> <20180108115257.GB27412@altlinux.org>
* Dmitry V. Levin:
> On Tue, Dec 26, 2017 at 12:41:54AM +0300, 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)
>
> Florian, do you have any objections to this fix?
I still do not see the point, consdering that a test for posix_openpt
would still fail, had we one, but I don't have objections to the
change above.