diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-11 15:27:44 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-11 15:27:44 +0000 |
commit | 4cb67b0b1b9ce6ba8c524a3a5b4fbb8f8aa184bb (patch) | |
tree | 521e0720bfb45fd55e5fb5970cae76d38f60bc4d /nuttx/lib | |
parent | 75e67f05d4b97efc32d95b478ec1c1f959992a4b (diff) | |
download | px4-nuttx-4cb67b0b1b9ce6ba8c524a3a5b4fbb8f8aa184bb.tar.gz px4-nuttx-4cb67b0b1b9ce6ba8c524a3a5b4fbb8f8aa184bb.tar.bz2 px4-nuttx-4cb67b0b1b9ce6ba8c524a3a5b4fbb8f8aa184bb.zip |
Add dmesg command that can be used to dump the syslog
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4382 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r-- | nuttx/lib/stdio/Make.defs | 2 | ||||
-rw-r--r-- | nuttx/lib/stdio/lib_lowprintf.c | 7 | ||||
-rw-r--r-- | nuttx/lib/stdio/lib_rawprintf.c | 9 | ||||
-rw-r--r-- | nuttx/lib/stdio/lib_syslogstream.c | 4 |
4 files changed, 17 insertions, 5 deletions
diff --git a/nuttx/lib/stdio/Make.defs b/nuttx/lib/stdio/Make.defs index 690c83641..ddccaca71 100644 --- a/nuttx/lib/stdio/Make.defs +++ b/nuttx/lib/stdio/Make.defs @@ -52,7 +52,7 @@ STDIO_SRCS += lib_fopen.c lib_fclose.c lib_fread.c lib_libfread.c lib_fseek.c \ endif endif -ifdef ($(CONFIG_SYSLOG) +ifeq ($(CONFIG_SYSLOG),y) STDIO_SRCS += lib_syslogstream.c endif diff --git a/nuttx/lib/stdio/lib_lowprintf.c b/nuttx/lib/stdio/lib_lowprintf.c index 0314a27f0..e27a5021b 100644 --- a/nuttx/lib/stdio/lib_lowprintf.c +++ b/nuttx/lib/stdio/lib_lowprintf.c @@ -42,6 +42,10 @@ #include <debug.h> #include "lib_internal.h" +/* This interface can only be used from within the kernel */ + +#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__) + /**************************************************************************** * Definitions ****************************************************************************/ @@ -113,4 +117,5 @@ int lib_lowprintf(const char *fmt, ...) return ret; } -#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG*/ +#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG */ +#endif /* __KERNEL__ */ diff --git a/nuttx/lib/stdio/lib_rawprintf.c b/nuttx/lib/stdio/lib_rawprintf.c index d738b212a..a28e6b695 100644 --- a/nuttx/lib/stdio/lib_rawprintf.c +++ b/nuttx/lib/stdio/lib_rawprintf.c @@ -42,9 +42,16 @@ #include "lib_internal.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ +/* Some output destinations are only available from within the kernel */ + +#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__) +# undef CONFIG_SYSLOG +# undef CONFIG_ARCH_LOWPUTC +#endif + /**************************************************************************** * Private Type Declarations ****************************************************************************/ diff --git a/nuttx/lib/stdio/lib_syslogstream.c b/nuttx/lib/stdio/lib_syslogstream.c index 0b5a95144..3da066408 100644 --- a/nuttx/lib/stdio/lib_syslogstream.c +++ b/nuttx/lib/stdio/lib_syslogstream.c @@ -75,7 +75,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch) ****************************************************************************/ /**************************************************************************** - * Name: lib_sylogstream + * Name: lib_syslogstream * * Description: * Initializes a stream for use with the coinfigured syslog interface. @@ -89,7 +89,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch) * ****************************************************************************/ -void lib_sylogstream(FAR struct lib_outstream_s *stream) +void lib_syslogstream(FAR struct lib_outstream_s *stream) { stream->put = syslogstream_putc; #ifdef CONFIG_STDIO_LINEBUFFER |