From f905a46461adb38fa88c1ec8623b69e9325be070 Mon Sep 17 00:00:00 2001 From: David Betz Date: Sun, 8 Feb 2015 11:57:18 -0500 Subject: [PATCH] More tweaking of the serial setup for Linux. --- osint_linux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osint_linux.c b/osint_linux.c index 4dccdb7..fb652b9 100644 --- a/osint_linux.c +++ b/osint_linux.c @@ -172,6 +172,9 @@ int serial_init(const char* port, unsigned long baud) return 0; } + /* get the current options */ + chk("tcgetattr", tcgetattr(hSerial, &old_sparm)); + /* set the baud rate */ if (!serial_baud(baud)) { close(hSerial); @@ -253,8 +256,7 @@ int serial_baud(unsigned long baud) } /* get the current options */ - chk("tcgetattr", tcgetattr(hSerial, &old_sparm)); - sparm = old_sparm; + chk("tcgetattr", tcgetattr(hSerial, &sparm)); /* set raw input */ cfmakeraw(&sparm);