From 20040a73b09c18e3375f1cb27e3a4b2a80e685b5 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 15 Dec 2020 00:49:28 +0700 Subject: [PATCH] Use tcgetattr/tcsetattr in termios code, not ioctl. (#43) Previously, we were using ioctl directly on some platforms rather than always going through termios. This complicates portability. --- src/unixfork.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/unixfork.c b/src/unixfork.c index 1cf93fa..294b5b4 100644 --- a/src/unixfork.c +++ b/src/unixfork.c @@ -165,17 +165,9 @@ int ForkUnixShell(int slot, char ltr, char numb, char *termtype, char *shellarg) kill processing, echo, backspace to erase, echo ctrl chars as ^x, kill line by backspacing */ -#if defined(MACOSX) || defined(FREEBSD) tcgetattr(SlaveFD, &tio); -#else - ioctl(SlaveFD, TCGETS, (char *)&tio); -#endif tio.c_lflag |= ICANON | ECHO | ECHOE | ECHOCTL | ECHOKE; -#if defined(MACOSX) || defined(FREEBSD) tcsetattr(SlaveFD, TCSANOW, &tio); -#else - ioctl(SlaveFD, TCSETS, (char *)&tio); -#endif #endif /* USETERMIOS */ (void)dup2(SlaveFD, 0);