Fix restoring of inferior terminal settings
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / term.c
index 26d2c006ee4d3fd20d03e69268fec95732395188..40ca62bb98cbe6a1f65e009a6d6f5666f115dab6 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <termios.h>
+#include <unistd.h>
+
+static struct termios t;
+
+static void
+break_here ()
+{
+}
+
 int main ()
 {
+  tcgetattr (0, &t);
+  break_here ();
+
+  /* Disable ECHO.  */
+  t.c_lflag &= ~ECHO;
+  tcsetattr (0, TCSANOW, &t);
+  tcgetattr (0, &t);
+  break_here ();
+
+  tcgetattr (0, &t);
+  break_here ();
+
   return 0;
 }
This page took 0.0255 seconds and 4 git commands to generate.