serial: Shouldn't mangle pid when ISIG is changed

Let's check ISIG flag directly instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I060f70eefc79b1c34aa11ed4071179d2ae5fa5ca
This commit is contained in:
Xiang Xiao
2020-09-24 18:11:44 +08:00
committed by David Sidrane
parent c6b51771f0
commit 650e18baa1
3 changed files with 22 additions and 32 deletions
+4 -2
View File
@@ -373,9 +373,11 @@ void uart_recvchars_done(FAR uart_dev_t *dev)
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP)
int signo = 0;
/* Check if the SIGINT character is anywhere in the newly received DMA buffer. */
/* Check if the SIGINT character is anywhere in the newly received DMA
* buffer.
*/
if (dev->pid >= 0)
if (dev->pid >= 0 && (dev->tc_lflag & ISIG))
{
signo = uart_recvchars_signo(dev);
}