Summary: | Pty.cxx frysk::sys::Pty::setUpPtyForConsole uses system() calls to set tty properties | ||
---|---|---|---|
Product: | frysk | Reporter: | Phil Muldoon <pmuldoon> |
Component: | general | Assignee: | Andrew Cagney <cagney> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Bug Depends on: | |||
Bug Blocks: | 2246 |
Description
Phil Muldoon
2007-01-26 19:02:57 UTC
What the system() stuff below is doing is setting the way the tty works. It could be done w/o system() by using terminal control ops similar to the following: { struct termios tio; if (0 > tcgetattr(fd, *tio)) return -1; tio.c_lflag |= ICANON | ECHO; tio.c_cc[VMIN] = 1; if (0 < tcsetattr(fd, TCSANOW, ,&tio)) return -1; return 0; } where fd is the file descriptor associated with pts_name. There are a few other wrinkles that might be relevant, but they'd depend on what else is going on. Code deleted, instead use frysk.sys.termios to manipulate the terminal; for this specific case, CLI already does the manipulations so call was redundant. Index: frysk-gui/frysk/gui/monitor/ChangeLog 2007-02-19 Andrew Cagney <cagney@redhat.com> * ConsoleWidget.java: Delete call to PseudoTerminal .setUpForConsole. Index: frysk-imports/frysk/sys/ChangeLog 2007-02-19 Andrew Cagney <cagney@redhat.com> * PseudoTerminal.java (setUpForConsole): Delete. * cni/PseudoTerminal.cxx: Ditto. * termios/: New directory. |