From patchwork Mon Dec 25 21:41:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dmitry V. Levin" X-Patchwork-Id: 852873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-88598-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="eVKq1Biu"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z5CHx1k8jz9ryk for ; Tue, 26 Dec 2017 08:42:04 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=Mku8cmC6En6J21kYWQ81GxV/d6eJW KptseAc9L8lTkr1ffsJFCNGBjww3MBEKuMf5kuMTOHCVzBnN4PRC31b8hJvggAfw y8uIIK7JMzZleltwSvy7tcBorCCtJCocqy+NLXzQuZMUhi0srmT5RXkwu1M3uYNN JggGEroowHbn4U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=60VbM85yO6w7maJaGmwOdbSaSVQ=; b=eVK q1BiuPDSzOD9wXpPHj0YanavXd2oMSilkgQR/Exm6tVM9n8i20Iooj2X/xqYiUTo BdPBIy3ygWZWcSajKS0r7pCJJhTluTdfoWE2l2WVOgeF6JH2uYybNi+snr0x6jcB xPMV7F/V+tPRLLuYqKjotwU3u2yAoZgY5UZib6jw= Received: (qmail 19724 invoked by alias); 25 Dec 2017 21:41:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 19670 invoked by uid 89); 25 Dec 2017 21:41:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: vmicros1.altlinux.org Date: Tue, 26 Dec 2017 00:41:54 +0300 From: "Dmitry V. Levin" To: libc-alpha@sourceware.org Subject: [PATCH v2] tst-ttyname: skip the test when /dev/ptmx is not available Message-ID: <20171225214154.GB11045@altlinux.org> Mail-Followup-To: libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline * 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)