From 28192d3c6007bb406ddbdb35a2fb1a0ffcacbd10 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Jun 2016 20:10:19 -0600 Subject: [PATCH] Re-order some conditional compilation; up_interrupt_context() is not generally available to applications. --- libc/syslog/lib_syslog.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libc/syslog/lib_syslog.c b/libc/syslog/lib_syslog.c index 32087d86f7..8b8ad24882 100644 --- a/libc/syslog/lib_syslog.c +++ b/libc/syslog/lib_syslog.c @@ -163,9 +163,15 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { int ret = 0; +#if defined(CONFIG_BUILD_FLAT) || defined (__KERNEL__) + /* up_interrupt_context() and lowvsyslog() are only available in the FLAT + * build or during the kernel pass of the protected or kernel two pass + * builds. + */ + #if !defined(CONFIG_SYSLOG) && CONFIG_NFILE_DESCRIPTORS > 0 - /* Are we are generating output on stdout? If so, was this function - * called from an interrupt handler? We cannot send data to stdout from + /* We are generating output on stdout. So check if this function was + * called from an interrupt handler. We cannot send data to stdout from * an interrupt handler. */ @@ -178,17 +184,13 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) * output destination as stdout! */ -#if defined(CONFIG_BUILD_FLAT) || defined (__KERNEL__) - /* lowvsyslog() in only available in the FLAT build or during the - * kernel pass of the protected or kernel two pass builds. - */ - ret = lowvsyslog(priority, fmt, ap); -#endif -#endif + +#endif /* CONFIG_ARCH_LOWPUTC */ } else -#endif +#endif /* !CONFIG_SYSLOG && CONFIG_NFILE_DESCRIPTORS > 0 */ +#endif /* CONFIG_BUILD_FLAT || __KERNEL */ { /* Check if this priority is enabled */