diff options
Diffstat (limited to 'libc/misc/syslog/syslog.c')
-rw-r--r-- | libc/misc/syslog/syslog.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c index 69ff0b38b..5605aecf1 100644 --- a/libc/misc/syslog/syslog.c +++ b/libc/misc/syslog/syslog.c @@ -31,6 +31,10 @@ * SUCH DAMAGE. */ +#define time __time +#define ctime __ctime +#define sigaction __sigaction_internal + #define __FORCE_GLIBC #define _GNU_SOURCE #include <features.h> @@ -82,14 +86,11 @@ #ifdef __UCLIBC_HAS_THREADS__ -#include <pthread.h> +# include <pthread.h> static pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK -# define UNLOCK #endif +#define LOCK __pthread_mutex_lock(&mylock) +#define UNLOCK __pthread_mutex_unlock(&mylock) static int LogFile = -1; /* fd for log */ @@ -136,18 +137,8 @@ sigpipe_handler (int sig) * syslog, vsyslog -- * print message on log file; output is intended for syslogd(8). */ -void -syslog(int pri, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vsyslog(pri, fmt, ap); - va_end(ap); -} - -void -vsyslog( int pri, const char *fmt, va_list ap ) +void attribute_hidden +__vsyslog( int pri, const char *fmt, va_list ap ) { register char *p; char *last_chr, *head_end, *end, *stdp; @@ -190,7 +181,7 @@ vsyslog( int pri, const char *fmt, va_list ap ) p += sprintf(p, "<BUFFER OVERRUN ATTEMPT>"); } if (LogStat & LOG_PID) - p += sprintf(p, "[%d]", getpid()); + p += sprintf(p, "[%d]", __getpid()); if (LogTag) { *p++ = ':'; *p++ = ' '; @@ -267,12 +258,24 @@ getout: sigaction (SIGPIPE, &oldaction, (struct sigaction *) NULL); } +strong_alias(__vsyslog,vsyslog) + +void attribute_hidden +__syslog(int pri, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + __vsyslog(pri, fmt, ap); + va_end(ap); +} +strong_alias(__syslog,syslog) /* * OPENLOG -- open system log */ -void -openlog( const char *ident, int logstat, int logfac ) +void attribute_hidden +__openlog( const char *ident, int logstat, int logfac ) { int logType = SOCK_DGRAM; @@ -319,15 +322,17 @@ retry: UNLOCK; } +strong_alias(__openlog,openlog) /* * CLOSELOG -- close the system log */ -void -closelog( void ) +void attribute_hidden +__closelog( void ) { closelog_intern(1); } +strong_alias(__closelog,closelog) /* setlogmask -- set the log mask level */ int setlogmask(int pmask) |