[git commit] syslog.c: no need for hidden vsyslog, use a static __vsyslog instead

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:36 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=daace91624c983b0dabd1c4f391b45cfc5528701
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

It is only used within the same file.
Guard the visible version according to header.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 include/sys/syslog.h      |    1 -
 libc/misc/syslog/syslog.c |   12 +++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 8fc7688..29a1233 100644
--- a/include/sys/syslog.h
+++ b/include/sys/syslog.h
@@ -208,7 +208,6 @@ libc_hidden_proto(syslog)
    therefore not marked with __THROW.  */
 extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
      __attribute__ ((__format__ (__printf__, 2, 0)));
-libc_hidden_proto(vsyslog)
 #endif
 
 __END_DECLS
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index 1b109e5..f79b92f 100644
--- a/libc/misc/syslog/syslog.c
+++ b/libc/misc/syslog/syslog.c
@@ -181,8 +181,12 @@ libc_hidden_def(openlog)
  * syslog, vsyslog --
  *     print message on log file; output is intended for syslogd(8).
  */
+static
+#ifndef __USE_BSD
+__always_inline
+#endif
 void
-vsyslog(int pri, const char *fmt, va_list ap)
+__vsyslog(int pri, const char *fmt, va_list ap)
 {
 	register char *p;
 	char *last_chr, *head_end, *end, *stdp;
@@ -301,7 +305,9 @@ vsyslog(int pri, const char *fmt, va_list ap)
  getout:
 	__UCLIBC_MUTEX_UNLOCK(mylock);
 }
-libc_hidden_def(vsyslog)
+#ifdef __USE_BSD
+strong_alias(__vsyslog,vsyslog)
+#endif
 
 void
 syslog(int pri, const char *fmt, ...)
@@ -309,7 +315,7 @@ syslog(int pri, const char *fmt, ...)
 	va_list ap;
 
 	va_start(ap, fmt);
-	vsyslog(pri, fmt, ap);
+	__vsyslog(pri, fmt, ap);
 	va_end(ap);
 }
 libc_hidden_def(syslog)


More information about the uClibc-cvs mailing list