use freopen(3) correctly
This commit is contained in:
parent
efe6d37f68
commit
1e80be4840
@ -296,7 +296,7 @@ static void nmstermio_set_terminal(int s) {
|
|||||||
static int state = 1;
|
static int state = 1;
|
||||||
|
|
||||||
if (!isatty(STDIN_FILENO)) {
|
if (!isatty(STDIN_FILENO)) {
|
||||||
stdin = freopen("/dev/tty", "r", stdin);
|
freopen("/dev/tty", "r", stdin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s == 0) {
|
if (s == 0) {
|
||||||
|
@ -28,7 +28,7 @@ static int foregroundColor = COLOR_BLUE; // Foreground color settin
|
|||||||
*/
|
*/
|
||||||
void nmstermio_init_terminal(void) {
|
void nmstermio_init_terminal(void) {
|
||||||
if (!isatty(STDIN_FILENO)) {
|
if (!isatty(STDIN_FILENO)) {
|
||||||
stdin = freopen("/dev/tty", "r", stdin);
|
freopen("/dev/tty", "r", stdin);
|
||||||
}
|
}
|
||||||
initscr();
|
initscr();
|
||||||
cbreak();
|
cbreak();
|
||||||
|
Loading…
Reference in New Issue
Block a user