[PATCH 4/5] linux ttyname and ttyname_r: Make the TTY equivalence tests consistent [BZ #22145]
Dmitry V. Levin
ldv@altlinux.org
Thu Oct 12 18:55:00 GMT 2017
On Wed, Oct 11, 2017 at 11:53:20PM -0400, Luke Shumaker wrote:
[...]
> --- a/sysdeps/unix/sysv/linux/ttyname.c
> +++ b/sysdeps/unix/sysv/linux/ttyname.c
> @@ -35,14 +35,14 @@
> char *__ttyname;
> #endif
>
> -static char *getttyname (const char *dev, dev_t mydev,
> - ino64_t myino, int save, int *dostat);
> +static char *getttyname (const char *dev, struct stat64 *mytty,
> + int save, int *dostat);
This has to be "const struct stat64 *".
>
> libc_freeres_ptr (static char *getttyname_name);
>
> static char *
> attribute_compat_text_section
> -getttyname (const char *dev, dev_t mydev, ino64_t myino, int save, int *dostat)
> +getttyname (const char *dev, struct stat64 *mytty, int save, int *dostat)
Likewise.
[...]
> --- a/sysdeps/unix/sysv/linux/ttyname.h
> +++ b/sysdeps/unix/sysv/linux/ttyname.h
> @@ -33,3 +33,15 @@ is_pty (struct stat64 *sb)
> return false;
> #endif
> }
> +
> +static inline int
> +is_mytty(struct stat64 *mytty, struct stat64 *maybe)
> +{
Likewise.
[...]
> diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
> index 18f35ef2b7..d975d95d0d 100644
> --- a/sysdeps/unix/sysv/linux/ttyname_r.c
> +++ b/sysdeps/unix/sysv/linux/ttyname_r.c
> @@ -31,12 +31,12 @@
> #include "ttyname.h"
>
> static int getttyname_r (char *buf, size_t buflen,
> - dev_t mydev, ino64_t myino, int save,
> + struct stat64 *mytty, int save,
> int *dostat);
Likewise.
>
> static int
> attribute_compat_text_section
> -getttyname_r (char *buf, size_t buflen, dev_t mydev, ino64_t myino,
> +getttyname_r (char *buf, size_t buflen, struct stat64 *mytty,
> int save, int *dostat)
> {
Likewise.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20171012/25b21c3d/attachment.sig>
More information about the Libc-alpha
mailing list