[PATCH v2 4/5] linux ttyname and ttyname_r: Don't bail prematurely [BZ #22145]
Andreas Schwab
schwab@suse.de
Wed Nov 8 08:33:00 GMT 2017
On Nov 02 2017, Luke Shumaker <lukeshu@parabola.nu> wrote:
> @@ -195,5 +190,15 @@ ttyname (int fd)
> name = getttyname ("/dev", &st, save, &dostat);
> }
>
> + if (!name && doispty && is_pty (&st))
> + {
> + /* We failed to figure out the TTY's name, but we can at least
> + * signal that we did verify that it really is a PTY slave.
> + * This happens when we have inherited the file descriptor from
> + * a different mount namespace. */
Style: no '*', two spaces after period.
> @@ -190,6 +184,16 @@ __ttyname_r (int fd, char *buf, size_t buflen)
> save, &dostat);
> }
>
> + if (ret && doispty && is_pty (&st))
> + {
> + /* We failed to figure out the TTY's name, but we can at least
> + * signal that we did verify that it really is a PTY slave.
> + * This happens when we have inherited the file descriptor from
> + * a different mount namespace. */
Likewise.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list