summaryrefslogtreecommitdiffstats
path: root/klibc
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-10-23 09:12:41 +0200
committerGreg KH <gregkh@suse.de>2005-04-27 06:06:22 +0200
commit606bce83da8edaa63d249a15c2d7439856526249 (patch)
tree693659d5b34f947e4b60b3b6881634453d14eaba /klibc
parent[PATCH] add ftruncate to klibc. (diff)
downloadsystemd-606bce83da8edaa63d249a15c2d7439856526249.tar.xz
systemd-606bce83da8edaa63d249a15c2d7439856526249.zip
[PATCH] added vsyslog support to klibc.
Diffstat (limited to 'klibc')
-rw-r--r--klibc/klibc/include/syslog.h2
-rw-r--r--klibc/klibc/syslog.c14
2 files changed, 12 insertions, 4 deletions
diff --git a/klibc/klibc/include/syslog.h b/klibc/klibc/include/syslog.h
index b6c0acfea1..a58ef05674 100644
--- a/klibc/klibc/include/syslog.h
+++ b/klibc/klibc/include/syslog.h
@@ -6,6 +6,7 @@
#define _SYSLOG_H
#include <klibc/extern.h>
+#include <stdarg.h>
/* Alert levels */
#define LOG_EMERG 0
@@ -49,5 +50,6 @@
__extern void openlog(const char *, int, int);
__extern void syslog(int, const char *, ...);
__extern void closelog(void);
+__extern void vsyslog(int, const char *format, va_list ap);
#endif /* _SYSLOG_H */
diff --git a/klibc/klibc/syslog.c b/klibc/klibc/syslog.c
index b031d4f0e7..d40d8633d1 100644
--- a/klibc/klibc/syslog.c
+++ b/klibc/klibc/syslog.c
@@ -40,9 +40,8 @@ void openlog(const char *ident, int option, int facility)
id[MAXID] = '\0'; /* Make sure it's null-terminated */
}
-void syslog(int prio, const char *format, ...)
+void vsyslog(int prio, const char *format, va_list ap)
{
- va_list ap;
char buf[BUFLEN];
int rv, len;
int fd;
@@ -62,9 +61,7 @@ void syslog(int prio, const char *format, ...)
if ( *id )
len += sprintf(buf+3, "%s: ", id);
- va_start(ap, format);
rv = vsnprintf(buf+len, BUFLEN-len, format, ap);
- va_end(ap);
len += rv;
if ( len > BUFLEN-1 ) len = BUFLEN-1;
@@ -72,3 +69,12 @@ void syslog(int prio, const char *format, ...)
write(fd, buf, len+1);
}
+
+void syslog(int prio, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ vsyslog(prio, format, ap);
+ va_end(ap);
+}