aboutsummaryrefslogtreecommitdiff
path: root/nuttx/libc/stdio/lib_syslogstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/libc/stdio/lib_syslogstream.c')
-rw-r--r--nuttx/libc/stdio/lib_syslogstream.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/nuttx/libc/stdio/lib_syslogstream.c b/nuttx/libc/stdio/lib_syslogstream.c
index 5529c5de8..e29c5ca3d 100644
--- a/nuttx/libc/stdio/lib_syslogstream.c
+++ b/nuttx/libc/stdio/lib_syslogstream.c
@@ -71,22 +71,23 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
do
{
- /* Write the character to the supported logging device */
+ /* Write the character to the supported logging device. On failure,
+ * syslog_putc returns EOF with the errno value set;
+ */
ret = syslog_putc(ch);
- if (ret == OK)
+ if (ret != EOF)
{
this->nput++;
return;
}
- /* On failure syslog_putc will return a negated errno value. The
- * errno variable will not be set. The special value -EINTR means that
- * syslog_putc() was awakened by a signal. This is not a real error and
- * must be ignored in this context.
+ /* The special errno value -EINTR means that syslog_putc() was
+ * awakened by a signal. This is not a real error and must be
+ * ignored in this context.
*/
}
- while (ret == -EINTR);
+ while (errno == -EINTR);
}
/****************************************************************************