X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=klibc%2Fklibc%2Fsyslog.c;h=d40d8633d1cd2e39d1a118ac202fbed24ff2d2dc;hp=b031d4f0e7946ac45356220445ca9df7df3f7153;hb=606bce83da8edaa63d249a15c2d7439856526249;hpb=1861680616736c7be1b014173e0cc0d5054b710a diff --git a/klibc/klibc/syslog.c b/klibc/klibc/syslog.c index b031d4f0e..d40d8633d 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); +}