[Bug 9851] New: vi: can't read user input if stdin is left in non-blocking mode
bugzilla at busybox.net
bugzilla at busybox.net
Fri Apr 28 18:04:46 UTC 2017
https://bugs.busybox.net/show_bug.cgi?id=9851
Bug ID: 9851
Summary: vi: can't read user input if stdin is left in
non-blocking mode
Product: Busybox
Version: 1.24.x
Hardware: All
OS: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
Assignee: unassigned at busybox.net
Reporter: daniel.f.starke at freenet.de
CC: busybox-cvs at busybox.net
Target Milestone: ---
Created attachment 7056
--> https://bugs.busybox.net/attachment.cgi?id=7056&action=edit
proposed patch
Using Busybox 1.26.2 I still experience the issue that the vi will not work if
some application (mostly those using ncurses) left the standard input in
non-blocking mode. Usually there are no means to reset this state with standard
commands without restarting the current tty.
The attached file fixes this issue by forcing blocking mode to the standard
input at vi start-up.
The patch did not change the size of the vi application in my configuration.
The issue can be reproduced by the following command:
gcc -x c -o nb - <<"_C" && chmod u+rx nb && ./nb && echo abc >a.txt && vi a.txt
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
/* make standard input non-blocking */
fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) |
O_NONBLOCK);
return EXIT_SUCCESS;
}
_C
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list