diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 3d188174b3d..60ca70b3e06 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/arm/src/arm/up_assert.c * - * Copyright (C) 2007-2010, 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2012-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +49,7 @@ #include #include #include +#include #include #include @@ -148,12 +150,12 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); - return ret; + return OK; } static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index f218cd477b0..99c3f2cbae2 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv6-m/up_assert.c * - * Copyright (C) 2013-2015, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2015, 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -190,10 +191,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 72952e0cfaa..7f1e70e4c9f 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_assert.c * - * Copyright (C) 2013-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -183,10 +184,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index 11f29cd6534..ab37542a39f 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_assert.c * - * Copyright (C) 2009-2010, 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2012-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,7 @@ #include #include #include +#include #include #include @@ -196,10 +198,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index b841416450b..cc5d7187aa7 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-r/arm_assert.c * - * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -183,10 +184,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index 92c3bde0175..e7e70bc8864 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/avr/src/common/up_assert.c * - * Copyright (C) 2010-2011, 2013-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2013-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,7 @@ #include #include #include +#include #include #include @@ -106,10 +108,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index 496b3933a66..87257f706a9 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/hc/src/m9s12/m9s12_assert.c * - * Copyright (C) 2011-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -141,10 +142,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/mips/src/mips32/up_assert.c b/arch/mips/src/mips32/up_assert.c index 5723fe18405..259d1406198 100644 --- a/arch/mips/src/mips32/up_assert.c +++ b/arch/mips/src/mips32/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/mips32/up_assert.c * - * Copyright (C) 2011-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2015, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -106,10 +107,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/misoc/src/lm32/lm32_assert.c b/arch/misoc/src/lm32/lm32_assert.c index 78e7d2b6680..0dfb71126ad 100644 --- a/arch/misoc/src/lm32/lm32_assert.c +++ b/arch/misoc/src/lm32/lm32_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/misoc/src/lm32/lm32_assert.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * Ramtin Amin * @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -107,10 +108,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/renesas/src/common/up_assert.c b/arch/renesas/src/common/up_assert.c index eaee6f7fec0..682761ff983 100644 --- a/arch/renesas/src/common/up_assert.c +++ b/arch/renesas/src/common/up_assert.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/renesas/src/common/up_assert.c * - * Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,7 @@ #include #include #include +#include #include #include @@ -107,10 +109,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/risc-v/src/rv32im/up_assert.c b/arch/risc-v/src/rv32im/up_assert.c index a5edaa54d18..8774e5ec9b9 100644 --- a/arch/risc-v/src/rv32im/up_assert.c +++ b/arch/risc-v/src/rv32im/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/risc-v/src/rv32im/up_assert.c * - * Copyright (C) 2011-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2015, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -106,10 +107,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 7afec4e4bec..3b9d00cac2c 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/common/up_assert.c * - * Copyright (C) 2011-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -100,10 +101,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/xtensa/src/common/xtensa_assert.c b/arch/xtensa/src/common/xtensa_assert.c index e290be637f9..b3379337fe0 100644 --- a/arch/xtensa/src/common/xtensa_assert.c +++ b/arch/xtensa/src/common/xtensa_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/xtensa/src/common/xtensa_assert.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -77,10 +78,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/z16/src/common/up_assert.c b/arch/z16/src/common/up_assert.c index 5346e9d48c9..3384969bcf2 100644 --- a/arch/z16/src/common/up_assert.c +++ b/arch/z16/src/common/up_assert.c @@ -1,7 +1,8 @@ /**************************************************************************** * common/up_assert.c * - * Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,7 @@ #include #include #include +#include #include #include @@ -106,10 +108,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index c361386d5f6..7aef249b4c0 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/z80/src/common/up_assert.c * - * Copyright (C) 2007-2009, 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,7 @@ #include #include #include +#include #include #include "chip.h" @@ -105,10 +107,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_EMERG, fmt, ap); + ret = nx_vsyslog(LOG_EMERG, fmt, &ap); va_end(ap); return ret; } diff --git a/drivers/syslog/vsyslog.c b/drivers/syslog/vsyslog.c index 58123331b0a..78a4120e8e8 100644 --- a/drivers/syslog/vsyslog.c +++ b/drivers/syslog/vsyslog.c @@ -54,10 +54,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: _vsyslog + * Name: nx_vsyslog * * Description: - * _vsyslog() handles the system logging system calls. It is functionally + * nx_vsyslog() handles the system logging system calls. It is functionally * equivalent to vsyslog() except that (1) the per-process priority * filtering has already been performed and the va_list parameter is * passed by reference. That is because the va_list is a structure in @@ -66,7 +66,7 @@ * ****************************************************************************/ -int _vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap) +int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap) { struct lib_syslogstream_s stream; int ret; diff --git a/drivers/usbdev/usbdev_trace.c b/drivers/usbdev/usbdev_trace.c index 857cd3e0294..f1dcaefe835 100644 --- a/drivers/usbdev/usbdev_trace.c +++ b/drivers/usbdev/usbdev_trace.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/usbdev/usbdev_trace.c * - * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2012, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,7 +46,9 @@ #include #include +#include #include + #undef usbtrace /**************************************************************************** @@ -100,10 +102,10 @@ static int usbtrace_syslog(const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_INFO, fmt, ap); + ret = nx_vsyslog(LOG_INFO, fmt, &ap); va_end(ap); return ret; } diff --git a/drivers/usbmonitor/usbmonitor.c b/drivers/usbmonitor/usbmonitor.c index 548c39b7499..f7e133eb7fa 100644 --- a/drivers/usbmonitor/usbmonitor.c +++ b/drivers/usbmonitor/usbmonitor.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/usbmonitor/usbmonitor.c * - * Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ #include #include +#include #include #include @@ -144,10 +145,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...) va_list ap; int ret; - /* Let vsyslog do the real work */ + /* Let nx_vsyslog do the real work */ va_start(ap, fmt); - ret = vsyslog(LOG_INFO, fmt, ap); + ret = nx_vsyslog(LOG_INFO, fmt, &ap); va_end(ap); return ret; } diff --git a/include/debug.h b/include/debug.h index d7fe4ff642f..f4759c7c833 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1572,19 +1572,19 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, #ifndef CONFIG_CPP_HAVE_VARARGS #ifdef CONFIG_DEBUG_ALERT -int _alert(const char *format, ...); +void _alert(const char *format, ...); #endif #ifdef CONFIG_DEBUG_ERROR -int _err(const char *format, ...); +void _err(const char *format, ...); #endif #ifdef CONFIG_DEBUG_WARN -int _warn(const char *format, ...); +void _warn(const char *format, ...); #endif #ifdef CONFIG_DEBUG_INFO -int _info(const char *format, ...); +void _info(const char *format, ...); #endif #endif /* CONFIG_CPP_HAVE_VARARGS */ diff --git a/include/nuttx/syslog/syslog.h b/include/nuttx/syslog/syslog.h index 1ea41be2ef3..ced488cfb6a 100644 --- a/include/nuttx/syslog/syslog.h +++ b/include/nuttx/syslog/syslog.h @@ -263,10 +263,10 @@ int syslog_flush(void); #endif /**************************************************************************** - * Name: _vsyslog + * Name: nx_vsyslog * * Description: - * _vsyslog() handles the system logging system calls. It is functionally + * nx_vsyslog() handles the system logging system calls. It is functionally * equivalent to vsyslog() except that (1) the per-process priority * filtering has already been performed and the va_list parameter is * passed by reference. That is because the va_list is a structure in @@ -275,7 +275,7 @@ int syslog_flush(void); * ****************************************************************************/ -int _vsyslog(int priority, FAR const IPTR char *src, FAR va_list *ap); +int nx_vsyslog(int priority, FAR const IPTR char *src, FAR va_list *ap); /**************************************************************************** * Name: syslog_register diff --git a/include/sys/syscall.h b/include/sys/syscall.h index c79dca741bc..d0223e9799a 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -263,7 +263,7 @@ /* Unconditional system logging */ -#define SYS__vsyslog (__SYS_syslog+0) +#define SYS_nx_vsyslog (__SYS_syslog+0) #define __SYS_descriptors (__SYS_syslog+1) /* The following are defined if either file or socket descriptor are diff --git a/include/syslog.h b/include/syslog.h index 59f1301fb49..bb05f26afd3 100644 --- a/include/syslog.h +++ b/include/syslog.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/syslog.h * - * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -212,8 +212,8 @@ void closelog(void); * ****************************************************************************/ -int syslog(int priority, FAR const IPTR char *fmt, ...); -int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap); +void syslog(int priority, FAR const IPTR char *fmt, ...); +void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap); /**************************************************************************** * Name: setlogmask diff --git a/libc/misc/lib_debug.c b/libc/misc/lib_debug.c index 098f3cc2dd7..75815ef2077 100644 --- a/libc/misc/lib_debug.c +++ b/libc/misc/lib_debug.c @@ -1,7 +1,8 @@ /**************************************************************************** * libc/misc/lib_err.c * - * Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -60,58 +61,46 @@ ****************************************************************************/ #ifdef CONFIG_DEBUG_ALERT -int _alert(const char *format, ...) +void _alert(const char *format, ...) { va_list ap; - int ret; va_start(ap, format); - ret = vsyslog(LOG_EMERG, format, ap); + vsyslog(LOG_EMERG, format, ap); va_end(ap); - - return ret; } #endif /* CONFIG_DEBUG_ALERT */ #ifdef CONFIG_DEBUG_ERROR -int _err(const char *format, ...) +void _err(const char *format, ...) { va_list ap; - int ret; va_start(ap, format); - ret = vsyslog(LOG_ERR, format, ap); + vsyslog(LOG_ERR, format, ap); va_end(ap); - - return ret; } #endif /* CONFIG_DEBUG_ERROR */ #ifdef CONFIG_DEBUG_WARN -int _warn(const char *format, ...) +void _warn(const char *format, ...) { va_list ap; - int ret; va_start(ap, format); - ret = vsyslog(LOG_WARNING, format, ap); + vsyslog(LOG_WARNING, format, ap); va_end(ap); - - return ret; } #endif /* CONFIG_DEBUG_WARN */ #ifdef CONFIG_DEBUG_INFO -int _info(const char *format, ...) +void _info(const char *format, ...) { va_list ap; - int ret; va_start(ap, format); - ret = vsyslog(LOG_INFO, format, ap); + vsyslog(LOG_INFO, format, ap); va_end(ap); - - return ret; } #endif /* CONFIG_DEBUG_INFO */ diff --git a/libc/stdio/lib_printf.c b/libc/stdio/lib_printf.c index 7c3e460b975..265e2fd26b5 100644 --- a/libc/stdio/lib_printf.c +++ b/libc/stdio/lib_printf.c @@ -1,7 +1,8 @@ /**************************************************************************** * libc/stdio/lib_printf.c * - * Copyright (C) 2007-2008, 2011-2012, 2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2008, 2011-2012, 2014, 2016, 2018 Gregory Nutt. All + * rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -40,6 +41,8 @@ #include #include +#include + #include "libc.h" /**************************************************************************** @@ -59,7 +62,7 @@ int printf(FAR const IPTR char *fmt, ...) #if CONFIG_NFILE_STREAMS > 0 ret = vfprintf(stdout, fmt, ap); #else - ret = vsyslog(LOG_INFO, fmt, ap); + ret = nx_vsyslog(LOG_INFO, fmt, &ap); #endif va_end(ap); diff --git a/libc/syslog/lib_syslog.c b/libc/syslog/lib_syslog.c index 408ffc10015..be12bce0a2f 100644 --- a/libc/syslog/lib_syslog.c +++ b/libc/syslog/lib_syslog.c @@ -1,7 +1,8 @@ /**************************************************************************** * libc/syslog/lib_syslog.c * - * Copyright (C) 2007-2009, 2011-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2014, 2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -57,27 +58,26 @@ * difference that it takes a set of arguments which have been obtained * using the stdarg variable argument list macros. * + * Returned Value: + * None. + * ****************************************************************************/ -int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) +void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { - int ret = 0; - /* Check if this priority is enabled */ if ((g_syslog_mask & LOG_MASK(priority)) != 0) { - /* Yes.. Perform the _vsyslog system call. + /* Yes.. Perform the nx_vsyslog system call. * * NOTE: The va_list parameter is passed by reference. That is * because the va_list is a structure in some compilers and passing * of structures in the NuttX sycalls does not work. */ - ret = _vsyslog(priority, fmt, &ap); + (void)nx_vsyslog(priority, fmt, &ap); } - - return ret; } /**************************************************************************** @@ -92,18 +92,18 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) * The NuttX implementation does not support any special formatting * characters beyond those supported by printf. * + * Returned Value: + * None. + * ****************************************************************************/ -int syslog(int priority, FAR const IPTR char *fmt, ...) +void syslog(int priority, FAR const IPTR char *fmt, ...) { va_list ap; - int ret; /* Let vsyslog do the work */ va_start(ap, fmt); - ret = vsyslog(priority, fmt, ap); + vsyslog(priority, fmt, ap); va_end(ap); - - return ret; } diff --git a/syscall/syscall.csv b/syscall/syscall.csv index ccec8647eda..f7330684f86 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -56,6 +56,7 @@ "mq_timedreceive","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","ssize_t","mqd_t","char*","size_t","int*","const struct timespec*" "mq_timedsend","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const char*","size_t","int","const struct timespec*" "mq_unlink","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","const char*" +"nx_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char*","FAR va_list*" "on_exit","stdlib.h","defined(CONFIG_SCHED_ONEXIT)","int","CODE void (*)(int, FAR void *)","FAR void *" "open","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","int","..." "opendir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR DIR*","FAR const char*" @@ -168,7 +169,6 @@ "up_assert","assert.h","","void","FAR const uint8_t*","int" #"up_assert","assert.h","","void" "vfork","unistd.h","defined(CONFIG_ARCH_HAVE_VFORK)","pid_t" -"_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char*","FAR va_list*" "wait","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","pid_t","int*" "waitid","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","int","idtype_t","id_t"," FAR siginfo_t *","int" "waitpid","sys/wait.h","defined(CONFIG_SCHED_WAITPID)","pid_t","pid_t","int*","int" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index e9a920c4e39..d8c4e91b416 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -1,7 +1,7 @@ /**************************************************************************** * syscall/syscall_lookup.h * - * Copyright (C) 2011, 2013-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -184,7 +184,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) /* System logging */ - SYSCALL_LOOKUP(_vsyslog, 3, STUB__vsyslog) + SYSCALL_LOOKUP(nx_vsyslog, 3, STUB_nx_vsyslog) /* The following are defined if either file or socket descriptor are * enabled. diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index 3db4ab90a0d..f6326e3bb14 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -1,7 +1,7 @@ /**************************************************************************** * syscall/syscall_stublookup.c * - * Copyright (C) 2011-2013, 2015-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2015-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -178,7 +178,7 @@ uintptr_t STUB_timer_settime(int nbr, uintptr_t parm1, uintptr_t parm2, /* System logging */ -uintptr_t STUB__vsyslog(int nbr, uintptr_t parm1, uintptr_t parm2, +uintptr_t STUB_nx_vsyslog(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3); /* The following are defined if either file or socket descriptor are