diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-28 17:43:55 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-28 17:43:55 +0000 |
commit | 00aaf1187f47fd3e9a2801b6468d1f382819981c (patch) | |
tree | 76d575d4d2acd9b74dcfbabb60727d85444fb733 /nuttx/libc/stdio/lib_syslogstream.c | |
parent | e530202ed1c43f468e236add225e51080120ea56 (diff) | |
download | px4-nuttx-00aaf1187f47fd3e9a2801b6468d1f382819981c.tar.gz px4-nuttx-00aaf1187f47fd3e9a2801b6468d1f382819981c.tar.bz2 px4-nuttx-00aaf1187f47fd3e9a2801b6468d1f382819981c.zip |
Misc SYSLOG and STM32 serial fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5576 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/libc/stdio/lib_syslogstream.c')
-rw-r--r-- | nuttx/libc/stdio/lib_syslogstream.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/nuttx/libc/stdio/lib_syslogstream.c b/nuttx/libc/stdio/lib_syslogstream.c index 5529c5de8..121227d3c 100644 --- a/nuttx/libc/stdio/lib_syslogstream.c +++ b/nuttx/libc/stdio/lib_syslogstream.c @@ -63,6 +63,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch) { + int errcode; int ret; /* Try writing until the write was successful or until an irrecoverable @@ -71,22 +72,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); } /**************************************************************************** |