From 9030db46cc3f89efd613ab064930db548ed8874f Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Mon, 17 May 2010 01:37:02 +0200 Subject: osmocon.c: Fix serial_set_baudrate function We have to call tcgetattr prior to changing the baudrate and writing the struct again. --- src/host/osmocon/osmocon.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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); -- cgit v1.2.3