summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2010-05-17 01:37:02 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-17 09:24:01 +0200
commit9030db46cc3f89efd613ab064930db548ed8874f (patch)
tree7994dfc4a606a696b0c763faeefd684bf2f78169 /src
parentdbfa321c42c182a6964f25364c954f6f775b51e7 (diff)
osmocon.c: Fix serial_set_baudrate function
We have to call tcgetattr prior to changing the baudrate and writing the struct again.
Diffstat (limited to 'src')
-rw-r--r--src/host/osmocon/osmocon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index b823b5b8..df242b13 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -230,6 +230,11 @@ static int serial_set_baudrate(speed_t baudrate)
int rc;
struct termios tio;
+ rc = tcgetattr(dnload.serial_fd.fd, &tio);
+ if (rc < 0) {
+ perror("tcgetattr()");
+ return rc;
+ }
cfsetispeed(&tio, baudrate);
cfsetospeed(&tio, baudrate);