You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/07 15:02:43 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3469: syslog: syslog_device ops are handled internally by the driver.

xiaoxiang781216 commented on a change in pull request #3469:
URL: https://github.com/apache/incubator-nuttx/pull/3469#discussion_r608735407



##########
File path: drivers/syslog/syslog.h
##########
@@ -324,6 +324,23 @@ ssize_t syslog_dev_write(FAR struct syslog_channel_s *channel,
 
 int syslog_dev_putc(FAR struct syslog_channel_s *channel, int ch);
 
+/****************************************************************************
+ * Name: syslog_dev_force
+ *
+ * Description:
+ *   Dummy, do nothing force write operation.
+ *
+ * Input Parameters:
+ *   channel    - Handle to syslog channel to be used.
+ *
+ * Returned Value:
+ *   On success, the character is echoed back to the caller.  A negated
+ *   errno value is returned on any failure.
+ *
+ ****************************************************************************/
+
+int syslog_dev_force(FAR struct syslog_channel_s *channel, int ch);

Review comment:
       let's change syslog_dev_xxx to static function too

##########
File path: drivers/syslog/syslog_devchannel.c
##########
@@ -169,9 +135,11 @@ int syslog_dev_channel(void)
       return -ENOMEM;
     }
 
-  /* Register the channel operations */
+  /* Register any custom channel operations */
 
-  g_syslog_dev_channel->sc_ops = &g_syslog_ops;
+#ifdef CONFIG_SYSLOG_CHAR_CRLF
+  g_syslog_dev_channel->sc_ops->sc_putc = syslog_devchan_putc;

Review comment:
       could remove syslog_devchan_putc to since syslogstream_putc already append '\r' before '\n'




-- 
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:
users@infra.apache.org