From patchwork Fri Nov 10 20:08:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Shumaker X-Patchwork-Id: 836862 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-86964-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="rFF10iiV"; 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 3yYWLs6QVkz9t3k for ; Sat, 11 Nov 2017 07:08:37 +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:from:to:cc:subject:date:message-id; q=dns; s= default; b=T2lr3eiuptjNivJBSKiI11rwUajFa/5jTdxfb8AvDd/bhgtcEPNqg Bh1tOIaD/YjMwXCENGnXx/gJpX6Ga+08L2ctkjhD+vwH0q9UCJWOPvzI68JBXvGa cYT7BCNoJ5W5o0vvpQ4iOCFtaN5i8+GNWLWNy4N3c4EBwJM4YOcAWA= 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:from:to:cc:subject:date:message-id; s=default; bh=VVQYDxbdrQVf6lASanR4Ravh9/s=; b=rFF10iiVe2G8fmizDeqYZwWBmkUR Ndeuin+UNNO9tlObCoDgwQr7g2QzHfAqyvage1qVMrk4WJIilBRO+3ioFUHBwMlT UgkcgSZxYc70CAoBqyZT7GJFZ9ut+9sTM7ygf4lPkbH/aHyBU3wqh/uwbWDOXO2u V0UCGEs5h6Ihkho= Received: (qmail 42286 invoked by alias); 10 Nov 2017 20:08:30 -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 41826 invoked by uid 89); 10 Nov 2017 20:08:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=theme, Hx-languages-length:1602 X-HELO: mav.lukeshu.com From: Luke Shumaker To: libc-alpha@sourceware.org Cc: christian.brauner@mailbox.org Subject: [PATCH v6 0/6] Fixup linux ttyname and ttyname_r [BZ #22145] Date: Fri, 10 Nov 2017 15:08:21 -0500 Message-Id: <20171110200827.32265-1-lukeshu@lukeshu.com> From: Luke Shumaker The theme of this patchset is to fixup the changes made in 15e9a4f. Fix a bug [BZ #22145] introduced in the commit (and add tests for both the bug it fixed and the bug it introduced!), update documentation to reflect the behavior introduced in the commit. The FSF has my copyright assignment on file. v2: - See individual commit messages v3: - Revise commit messages - Revise ChangeLog messages - Split one of the commits in to 2 separate commits - Fix style of comments (no "*" on continued lines, 2 spaces after trailing period) - Fix whitespace style in the definition of is_mytty v4: - Revise tst-ttyname v5: - Revise tst-ttyname v6: - No change, but resubmit entire patchset with new version Luke Shumaker (6): manual: Update to mention ENODEV for ttyname and ttyname_r linux ttyname: Update a reference to kernel docs for kernel 4.10 linux ttyname: Change return type of is_pty from int to bool linux ttyname and ttyname_r: Make the TTY equivalence checks consistent linux ttyname and ttyname_r: Don't bail prematurely [BZ #22145] linux ttyname and ttyname_r: Add tests ChangeLog | 26 ++ manual/terminal.texi | 5 + sysdeps/unix/sysv/linux/Makefile | 3 +- sysdeps/unix/sysv/linux/tst-ttyname.c | 625 ++++++++++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/ttyname.c | 59 ++-- sysdeps/unix/sysv/linux/ttyname.h | 17 +- sysdeps/unix/sysv/linux/ttyname_r.c | 61 ++-- 7 files changed, 714 insertions(+), 82 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/tst-ttyname.c