From b4655b250bb68f6a12c412eee942565d9264c1e3 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 2 Jun 2015 08:42:37 +0100 Subject: [PATCH] uart.c: Fix some wrong return checks Signed-off-by: Brendan Le Foll --- src/uart/uart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uart/uart.c b/src/uart/uart.c index 4a36415..6ab5e7f 100644 --- a/src/uart/uart.c +++ b/src/uart/uart.c @@ -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; }