Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15468 > unrolled thread

Re: bash sets O_NONBLOCK on pts

Started byStephane Chazelas <stephane.chazelas@gmail.com>
First post2019-10-03 19:23 +0100
Last post2019-10-03 19:23 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: bash sets O_NONBLOCK on pts Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-10-03 19:23 +0100

#15468 — Re: bash sets O_NONBLOCK on pts

FromStephane Chazelas <stephane.chazelas@gmail.com>
Date2019-10-03 19:23 +0100
SubjectRe: bash sets O_NONBLOCK on pts
Message-ID<mailman.899.1570127117.2651.bug-bash@gnu.org>
2019-10-03 13:58:40 -0400, Chet Ramey:
> On 10/2/19 11:38 AM, Stephane Chazelas wrote:
> 
> > BTW, what's the point of the check_dev_tty() function? It seems
> > it just attempts to open the tty (the controlling one or the one
> > open on stdin), closes it, but doesn't return anything about the
> > success of failure in doing so.
> 
> It's to make up for an old bug that's probably gone everywhere. Back
> in the day, there were systems and services that would start interactive
> shells without a controlling terminal. Opening and closing /dev/tty
> forced the controlling terminal to be allocated.
[...]

Thanks.

I suspected it may be something like that. Though I thought,
without actually double-checking it, that the rest of the code
would end up opening the terminal device (without O_NOCTTY) anyway.

It may be worth adding a comment to document that purpose of the
function, and maybe rename it to something like
control_tty_if_not_already_controlled or something that more
accurately describes its intent.

-- 
Stephane

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web