linux ttyname: Change return type of is_pty from int to bool

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 <christian.brauner@ubuntu.com>
This commit is contained in:
Luke Shumaker 2017-11-15 20:33:11 +01:00 committed by Christian Brauner
parent 9b5a87502d
commit d10d6cab16
No known key found for this signature in database
GPG Key ID: 7B3C391EFEA93624
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2017-11-15 Luke Shumaker <lukeshu@parabola.nu>
* 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):

View File

@ -16,6 +16,7 @@
not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <stdbool.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -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