From patchwork Mon Nov 13 21:28:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Shumaker X-Patchwork-Id: 837553 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-87041-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="RwKh0Sjx"; 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 3ybP0V0dB6z9s84 for ; Tue, 14 Nov 2017 08:29:13 +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:in-reply-to :references; q=dns; s=default; b=GnmTCxTVcuS6DBV0u9uZ6y4FLBfmczb hzQD4QOHQ42cWn9bUMUwksC4ZbClyxy9XsgnuhXT/EYQA+iWMqGfQ82+8AaObVup fiyiOzETDPNR/TuS6qJPV08JdM1DjDRI9/IwBXhsdKxs9W2r7bVRZIIUgY78UbJC ktzVhWu+j1bA= 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:in-reply-to :references; s=default; bh=hHYMexa30xMv9TUK7Wv3GMiKt/0=; b=RwKh0 SjxANHvwKKZgIPu8cuvacPOLr1GW+rbZ/tyFYu5ViuaT2jLZoFJ1eA1qhjgZcwM1 CsmaZkuPW5wyMnEoioyvd+ZdzPuLZ3MwbsWF+Yq/ynqxPLsRJUOnSWbLDx+sT3ol V4Vs2IrmZHbh3QTBoU9GNbB1mfQJpMcE2TxRNU= Received: (qmail 48865 invoked by alias); 13 Nov 2017 21:28:46 -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 48530 invoked by uid 89); 13 Nov 2017 21:28:45 -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, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mav.lukeshu.com From: Luke Shumaker To: libc-alpha@sourceware.org Cc: christian.brauner@mailbox.org Subject: [PATCH v7 3/6] linux ttyname: Change return type of is_pty from int to bool Date: Mon, 13 Nov 2017 16:28:38 -0500 Message-Id: <20171113212841.28518-4-lukeshu@lukeshu.com> In-Reply-To: <20171113212841.28518-1-lukeshu@lukeshu.com> References: <20171113212841.28518-1-lukeshu@lukeshu.com> From: Luke Shumaker is_pty returning a bool is fine since there's no possible outcome other than true or false, and bool is used throughout the codebase. v2: - Introduce as part of another commit v3: - Split into a separate commit v7: - Include --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/ttyname.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fd1124bd95..7035df540d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-11-07 Luke Shumaker + * sysdeps/unix/sysv/linux/ttyname.h (is_pty): Change return type from + int to bool. + * sysdeps/unix/sysv/linux/ttyname.h (is_pty): Update doc reference. * manual/terminal.texi (Is It a Terminal): diff --git a/sysdeps/unix/sysv/linux/ttyname.h b/sysdeps/unix/sysv/linux/ttyname.h index cbcdbab607..cdaf60fb87 100644 --- a/sysdeps/unix/sysv/linux/ttyname.h +++ b/sysdeps/unix/sysv/linux/ttyname.h @@ -16,6 +16,7 @@ not, see . */ #include +#include #include #include #include @@ -23,7 +24,7 @@ /* Return true if this is a UNIX98 pty device, as defined in linux/Documentation/devices.txt (on linux < 4.10) or linux/Documentation/admin-guide/devices.txt (on linux >= 4.10). */ -static inline int +static inline bool is_pty (struct stat64 *sb) { #ifdef _STATBUF_ST_RDEV