Commit 84894459 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra

valgrind: check successful read before attempting write

... this is actually not really a bug, but I can see why valgrind
complains, so let's keep it happy.
parent 10a8bcc8
......@@ -94,11 +94,13 @@ eb_status_t eb_dev_connect(struct eb_transport* transportp, struct eb_link* link
link->fdes = fdes;
link->flags = fcntl(fdes, F_GETFL, 0);
tcgetattr(fdes, &ios);
cfmakeraw(&ios);
cfsetispeed(&ios, B115200);
cfsetospeed(&ios, B115200);
tcsetattr(fdes, TCSANOW, &ios);
// If this is a serial device, enter raw mode
if (tcgetattr(fdes, &ios) == 0) {
cfmakeraw(&ios);
cfsetispeed(&ios, B115200);
cfsetospeed(&ios, B115200);
tcsetattr(fdes, TCSANOW, &ios);
}
eb_dev_set_blocking(link, 0);
/* Discard any data unread by last user */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment