Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Stephane Chazelas Newsgroups: gnu.bash.bug Subject: Re: bash sets O_NONBLOCK on pts Date: Wed, 2 Oct 2019 16:38:26 +0100 Lines: 38 Approved: bug-bash@gnu.org Message-ID: References: <20191002153826.vgn3qbtztgulgyef@chaz.gmail.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1570030819 7280 209.51.188.17 (2 Oct 2019 15:40:19 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Injected-Via-Gmane: http://gmane.org/ User-Agent: NeoMutt/20171215 Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20191002153826.vgn3qbtztgulgyef@chaz.gmail.com> X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:15460 2019-10-02 14:27:48 +0200, Matteo Croce: [...] > Sometimes bash leaves the pts with O_NONBLOCK set, and all programs > reading from stdin will get an EAGAIN: [...] Can you reproduce it with bash --norc Or with: INPUTRC=/dev/null bash --norc ? If you could reproduce it with: strace -o strace.log bash --norc that would allow us to see where a O_NONBLOCK flag is set and not reset. 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. On my system (Debian amd64, 5.0.3(1)-release, bash started from a regular terminal emulator), it's the only place where I see O_NONBLOCK being used (and that's on a new fd that is closed straight after, so it could not have any bearing on the OP's issue). -- Stephane