Private
Public Access
2
0

uart.c: Fix some wrong return checks

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-06-02 08:42:37 +01:00
parent 21355d4bb5
commit b4655b250b

View File

@@ -290,7 +290,7 @@ mraa_uart_set_mode(mraa_uart_context dev, int bytesize, mraa_uart_parity_t parit
}
struct termios termio;
if (!tcgetattr(dev->fd, &termio)) {
if (tcgetattr(dev->fd, &termio)) {
syslog(LOG_ERR, "uart: tcgetattr() failed");
return MRAA_ERROR_INVALID_HANDLE;
}
@@ -366,7 +366,7 @@ mraa_uart_set_flowcontrol(mraa_uart_context dev, mraa_boolean_t xonxoff, mraa_bo
if (xonxoff) {
action = TCION;
}
if (!tcflow(dev->fd, action)) {
if (tcflow(dev->fd, action)) {
return MRAA_ERROR_FEATURE_NOT_SUPPORTED;
}
@@ -374,7 +374,7 @@ mraa_uart_set_flowcontrol(mraa_uart_context dev, mraa_boolean_t xonxoff, mraa_bo
struct termios termio;
// get current modes
if (!tcgetattr(dev->fd, &termio)) {
if (tcgetattr(dev->fd, &termio)) {
syslog(LOG_ERR, "uart: tcgetattr() failed");
return MRAA_ERROR_INVALID_HANDLE;
}