osmocom: Fix serial init (CSIZE field)
authorSylvain Munaut <tnt@246tNt.com>
Wed, 21 Apr 2010 17:27:21 +0000 (19:27 +0200)
committerSylvain Munaut <tnt@246tNt.com>
Wed, 21 Apr 2010 17:27:21 +0000 (19:27 +0200)
Since we clear the whole CSIZE, we need to set CS8 _after_ the clearing
or it'll just get erased ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
src/host/osmocon/osmocon.c

index 850e928..b823b5b 100644 (file)
@@ -202,8 +202,8 @@ static int serial_init(const char *serial_port)
        }
        cfsetispeed(&tio, MODEM_BAUDRATE);
        cfsetospeed(&tio, MODEM_BAUDRATE);
-       tio.c_cflag |=  (CREAD | CLOCAL | CS8);
        tio.c_cflag &= ~(PARENB | CSTOPB | CSIZE | CRTSCTS);
+       tio.c_cflag |=  (CREAD | CLOCAL | CS8);
        tio.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
        tio.c_iflag |=  (INPCK | ISTRIP);
        tio.c_iflag &= ~(ISTRIP | IXON | IXOFF | IGNBRK | INLCR | ICRNL | IGNCR);