mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-17 00:22:59 +00:00
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.
This commit is contained in:
parent
52d3590401
commit
20040a73b0
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user