This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 4/5] linux ttyname and ttyname_r: Don't bail prematurely [BZ #22145]
- From: Andreas Schwab <schwab at suse dot de>
- To: Luke Shumaker <lukeshu at parabola dot nu>
- Cc: libc-alpha at sourceware dot org, christian dot brauner at mailbox dot org
- Date: Wed, 08 Nov 2017 09:32:56 +0100
- Subject: Re: [PATCH v2 4/5] linux ttyname and ttyname_r: Don't bail prematurely [BZ #22145]
- Authentication-results: sourceware.org; auth=none
- References: <20171102185346.1386-1-lukeshu@parabola.nu> <20171102185346.1386-5-lukeshu@parabola.nu>
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."