From patchwork Wed Nov 15 21:33:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 24270 Received: (qmail 18312 invoked by alias); 15 Nov 2017 21:33:28 -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 18244 invoked by uid 89); 15 Nov 2017 21:33:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx1.mailbox.org From: Christian Brauner To: libc-alpha@sourceware.org Cc: lukeshu@parabola.nu Subject: [PATCH COMMITTED 3/6] linux ttyname: Change return type of is_pty from int to bool Date: Wed, 15 Nov 2017 22:33:12 +0100 Message-Id: <20171115213315.7300-3-christian.brauner@ubuntu.com> In-Reply-To: <20171115213315.7300-1-christian.brauner@ubuntu.com> References: <20171115213315.7300-1-christian.brauner@ubuntu.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. Reviewed-by: Christian Brauner --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/ttyname.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6194237230..bb960c04bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-11-15 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