diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-11-15 20:33:11 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-12-22 15:23:52 +0100 |
commit | bd81a9d1e99f04d0b664542ddec2d270789f7ec1 (patch) | |
tree | 106a796f20d961450427ae353f0991bed27d9f02 | |
parent | 1f0ba053ed6d065b2261f49d77bdcf4a34255689 (diff) | |
download | glibc-bd81a9d1e99f04d0b664542ddec2d270789f7ec1.tar.gz glibc-bd81a9d1e99f04d0b664542ddec2d270789f7ec1.tar.xz glibc-bd81a9d1e99f04d0b664542ddec2d270789f7ec1.zip |
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> (cherry picked from commit d10d6cab168ffa26ef6a506655ee5dc8537c8ed7)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/ttyname.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 1fb584ae20..91e12d0f20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2017-11-15 Luke Shumaker <lukeshu@parabola.nu> + * sysdeps/unix/sysv/linux/ttyname.h (is_pty): Change return type from + int to bool. + +2017-11-15 Luke Shumaker <lukeshu@parabola.nu> + * sysdeps/unix/sysv/linux/ttyname.h (is_pty): Update doc reference. 2017-11-15 Luke Shumaker <lukeshu@parabola.nu> 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 <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 |