Menu

#506 Tcgetattr show error promp if stdin is not a tty.

version-1.8.18
open
nobody
None
5
2018-03-01
2018-03-01
Elaine Li
No

When start an SoL session via devconsole command, it always show 'tcgetattr: Invalid argument' at the top of the screen. If stdin is not a tty, we don't have to enter raw mode.
Add patch for tcgetattr error prompt.

--- ipmitool-1.8.18.orig/lib/ipmi_sol.c 2016-06-30 02:06:29.000000000 +0800
+++ ipmitool-1.8.18.new/lib/ipmi_sol.c 2018-02-27 19:03:04.686552700 +0800
@@ -1165,6 +1165,8 @@
enter_raw_mode(void)
{
struct termios tio;
+ if (isatty(fileno(stdin)) == 0)
+ return;
if (tcgetattr(fileno(stdin), &tio) == -1) {
perror("tcgetattr");
return;

Discussion


Log in to post a comment.