casaroli commented on code in PR #21157:
URL: https://github.com/apache/nuttx/pull/21157#discussion_r4435093785
##########
drivers/serial/serial.c:
##########
@@ -2572,52 +2572,113 @@ void uart_reset_sem(FAR uart_dev_t *dev)
defined(CONFIG_TTY_FORCE_PANIC) || defined(CONFIG_TTY_LAUNCH)
int uart_check_special(FAR uart_dev_t *dev, FAR const char *buf, size_t size)
{
- size_t i;
-
if ((dev->tc_lflag & ISIG) == 0)
{
return 0;
}
- for (i = 0; i < size; i++)
+ /* Walk the buffer, jumping to the next control character with memchr
+ * instead of scanning byte by byte. SIGINT/SIGTSTP stop the scan and
+ * return their signal; FORCE_PANIC and LAUNCH are handled in passing so
+ * that a later signal in the same buffer is still delivered.
+ */
+
+ while (size > 0)
Review Comment:
Master now takes the interrupt and suspend characters from c_cc:
uart_check_special() compares with dev->tc_vintr and dev->tc_vsusp and skips
_POSIX_VDISABLE (81b320b9724); CONFIG_TTY_SIGINT_CHAR and
CONFIG_TTY_SIGTSTP_CHAR only give the initial values. This PR searches for the
Kconfig characters, so it conflicts with master, and after a rebase that keeps
them a VINTR or VSUSP set with tcsetattr() has no effect.
Fix: rebase, and search for dev->tc_vintr and dev->tc_vsusp (only when they
are not _POSIX_VDISABLE).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]