Bug 9931 - stdin is not restored to blocking mode after a process exits
Summary: stdin is not restored to blocking mode after a process exits
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-02 12:37 UTC by Robbert
Modified: 2018-02-14 11:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robbert 2017-06-02 12:37:24 UTC
The fix for #9851 happened in vi, but the underlying issue affects any other process as well. Most tools can't handle stdin being in non-blocking mode. If you start a process that changes stdin to non-blocking (node js does this, for example) it gets left in non-blocking mode after the process exits. Cat and nano are examples of tools that cannot be started after this:

$ cat
cat: read error: Resource temporarily unavailable

Instead of the fix in vi (#9851), it should be fixed in the shell itself. After the foreground process exits, it should reset stdin to block mode. I believe this is what other shells do.