Re-order some conditional compilation; up_interrupt_context() is not generally available to applications.

This commit is contained in:
Gregory Nutt 2016-06-16 20:10:19 -06:00
parent ea8241027e
commit 28192d3c60
1 changed files with 12 additions and 10 deletions

View File

@ -163,9 +163,15 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap)
{ {
int ret = 0; 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 #if !defined(CONFIG_SYSLOG) && CONFIG_NFILE_DESCRIPTORS > 0
/* Are we are generating output on stdout? If so, was this function /* We are generating output on stdout. So check if this function was
* called from an interrupt handler? We cannot send data to stdout from * called from an interrupt handler. We cannot send data to stdout from
* an interrupt handler. * an interrupt handler.
*/ */
@ -178,17 +184,13 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap)
* output destination as stdout! * 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); ret = lowvsyslog(priority, fmt, ap);
#endif
#endif #endif /* CONFIG_ARCH_LOWPUTC */
} }
else else
#endif #endif /* !CONFIG_SYSLOG && CONFIG_NFILE_DESCRIPTORS > 0 */
#endif /* CONFIG_BUILD_FLAT || __KERNEL */
{ {
/* Check if this priority is enabled */ /* Check if this priority is enabled */