yangsong8-a1 commented on code in PR #21157:
URL: https://github.com/apache/nuttx/pull/21157#discussion_r4442858193
##########
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:
done, ths
--
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]