Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: achurch@achurch.org (Andrew Church) Newsgroups: gnu.bash.bug Subject: Re: bash sets O_NONBLOCK on pts Date: Thu, 03 Oct 2019 02:49:36 +0900 Lines: 20 Approved: bug-bash@gnu.org Message-ID: References: <5d94e361.21745@msgid.achurch.org> NNTP-Posting-Host: lists.gnu.org Content-Type: text/plain; charset=utf-8 X-Trace: usenet.stanford.edu 1570038640 12283 209.51.188.17 (2 Oct 2019 17:50:40 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: mcroce@redhat.com Envelope-to: bug-bash@gnu.org X-wmail-status: normal In-Reply-To: X-Mailer: MMail v5.51 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 60.39.233.218 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: <5d94e361.21745@msgid.achurch.org> Xref: csiph.com gnu.bash.bug:15462 >Well, it's not so uncommon, I had it a few times. Reading on internet >it seems that other users have it but don't notice it. The fault could be in some other program accessing the terminal. Bash does not clear O_NONBLOCK on displaying a prompt, so if a previously executed program sets O_NONBLOCK on stdin and then exits, that state will remain until some other program unsets it. For example: $ cat >foo.c #include int main(void) {fcntl(0, F_SETFL, O_NONBLOCK); return 0;} ^D $ cc foo.c $ ./a.out $ cat cat: -: Resource temporarily unavailable --Andrew Church http://achurch.org/