xiaoxiang781216 commented on a change in pull request #3050: URL: https://github.com/apache/incubator-nuttx/pull/3050#discussion_r598210517
########## File path: drivers/syslog/syslog_flush.c ########## @@ -64,21 +64,27 @@ int syslog_flush(void) { - DEBUGASSERT(g_syslog_channel != NULL); + int i; + + for (i = 0; i < CONFIG_SYSLOG_MAX_CHANNELS; i++) + { + if (g_syslog_channel[i] == NULL) + break; #ifdef CONFIG_SYSLOG_INTBUFFER - /* Flush any characters that may have been added to the interrupt - * buffer. - */ + /* Flush any characters that may have been added to the interrupt + * buffer. + */ - syslog_flush_intbuffer(g_syslog_channel, true); + syslog_flush_intbuffer(g_syslog_channel[i], true); Review comment: We just have one interrupt buffer, so the loop need move into syslog_flush_intbuffer otherwise, all channels except the first one lose the log happen in the interrupt handler. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org