From 759e510c28442e4d7732b963eca2bdec97a6e744 Mon Sep 17 00:00:00 2001 From: Gregory Nutt <gnutt@nuttx.org> Date: Mon, 26 Mar 2018 13:54:47 -0600 Subject: [PATCH] Per Matias Edlund: I recently used the tcflush function and found that it failed with ENOTTY. The reason is that the TCFLSH case in the function uart_ioctl in the file drivers/serial/serial.c does not update the ret value." On success, the TCFLSH IOCTL logic needs to explicitly set the return value (ret) to zero. --- drivers/serial/serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 1f6ab0fad2..d63f4837cb 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -1339,6 +1339,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } leave_critical_section(flags); + ret = 0; } break; -- GitLab