From 7dd66a4620921fb185b2c419b38df875ad02c1a6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 19 Jun 2016 14:50:00 -0600 Subject: [PATCH] Need to pass va_list as a reference to vsyslog. This is because va_list is a structure in some compilers and passing of structures in the NuttX sycalls does not work. --- drivers/syslog/vlowsyslog.c | 4 ++-- drivers/syslog/vsyslog.c | 4 ++-- include/nuttx/syslog/syslog.h | 4 ++-- libc/syslog/lib_lowsyslog.c | 2 +- libc/syslog/lib_syslog.c | 2 +- syscall/syscall.csv | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/syslog/vlowsyslog.c b/drivers/syslog/vlowsyslog.c index 465b63cd7b..e3e4051617 100644 --- a/drivers/syslog/vlowsyslog.c +++ b/drivers/syslog/vlowsyslog.c @@ -64,14 +64,14 @@ * ****************************************************************************/ -int _lowvsyslog(FAR const IPTR char *fmt, va_list ap) +int _lowvsyslog(FAR const IPTR char *fmt, FAR va_list *ap) { struct lib_outstream_s stream; /* Wrap the stdout in a stream object and let lib_vsprintf do the work. */ syslogstream((FAR struct lib_outstream_s *)&stream); - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); + return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, *ap); } #endif /* CONFIG_ARCH_LOWPUTC */ diff --git a/drivers/syslog/vsyslog.c b/drivers/syslog/vsyslog.c index 820c1bf1a6..fc9b9a1b9d 100644 --- a/drivers/syslog/vsyslog.c +++ b/drivers/syslog/vsyslog.c @@ -62,7 +62,7 @@ * ****************************************************************************/ -int _vsyslog(FAR const IPTR char *fmt, va_list ap) +int _vsyslog(FAR const IPTR char *fmt, FAR va_list *ap) { struct lib_outstream_s stream; #ifdef CONFIG_SYSLOG_TIMESTAMP @@ -96,5 +96,5 @@ int _vsyslog(FAR const IPTR char *fmt, va_list ap) #endif - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); + return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, *ap); } diff --git a/include/nuttx/syslog/syslog.h b/include/nuttx/syslog/syslog.h index 90123e6d35..18d20c98d2 100644 --- a/include/nuttx/syslog/syslog.h +++ b/include/nuttx/syslog/syslog.h @@ -216,8 +216,8 @@ int syslog_flush(void); * ****************************************************************************/ -int _vsyslog(FAR const IPTR char *src, va_list ap); -int _lowvsyslog(FAR const IPTR char *src, va_list ap); +int _vsyslog(FAR const IPTR char *src, FAR va_list *ap); +int _lowvsyslog(FAR const IPTR char *src, FAR va_list *ap); #undef EXTERN #ifdef __cplusplus diff --git a/libc/syslog/lib_lowsyslog.c b/libc/syslog/lib_lowsyslog.c index 1aa0a00f76..d86ab394ff 100644 --- a/libc/syslog/lib_lowsyslog.c +++ b/libc/syslog/lib_lowsyslog.c @@ -80,7 +80,7 @@ int lowvsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { /* Perform the _lowvsyslog system call */ - ret = _lowvsyslog(fmt, ap); + ret = _lowvsyslog(fmt, &ap); } return ret; diff --git a/libc/syslog/lib_syslog.c b/libc/syslog/lib_syslog.c index 5ac55eb6b7..700b99b48c 100644 --- a/libc/syslog/lib_syslog.c +++ b/libc/syslog/lib_syslog.c @@ -69,7 +69,7 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { /* Yes.. lPerform the _vsyslog system cal */ - ret = _vsyslog(fmt, ap); + ret = _vsyslog(fmt, &ap); } return ret; diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 573de95364..306d5c4cae 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -159,7 +159,7 @@ "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","syslog.h","","int","FAR const IPTR char*","va_list" +"_vsyslog","syslog.h","","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"