From 218e52d97218ac18cf5b0a74ee262ee490cdc7c9 Mon Sep 17 00:00:00 2001 From: Chris Sachs Date: Sat, 10 Jan 2015 19:30:49 -0800 Subject: fully initialize termios struct --- flow-native/src/platform/posix/flow.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'flow-native') diff --git a/flow-native/src/platform/posix/flow.c b/flow-native/src/platform/posix/flow.c index 1adb10c..a2a239c 100644 --- a/flow-native/src/platform/posix/flow.c +++ b/flow-native/src/platform/posix/flow.c @@ -54,12 +54,11 @@ int serial_open( /* configure new port settings */ struct termios newtio; - /* following calls correspond to makeraw() */ - newtio.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); - newtio.c_oflag &= ~OPOST; - newtio.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); - newtio.c_cflag &= ~(CSIZE | PARENB); - newtio.c_cflag |= CREAD; + /* initialize serial interface */ + newtio.c_iflag = 0; + newtio.c_oflag = 0; + newtio.c_lflag = 0; + newtio.c_cflag = CREAD; /* set speed */ speed_t bd; -- cgit v1.2.3