diff options
Diffstat (limited to 'winsup/cygwin/syslog.cc')
-rw-r--r-- | winsup/cygwin/syslog.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc index cf3931ffe76..f8b17149c8d 100644 --- a/winsup/cygwin/syslog.cc +++ b/winsup/cygwin/syslog.cc @@ -14,7 +14,6 @@ details. */ #include <syslog.h> #include <stdarg.h> #include <unistd.h> -#include <errno.h> #include "security.h" #include "path.h" #include "fhandler.h" @@ -208,7 +207,7 @@ pass_handler::print_va (const char *fmt, va_list list) */ extern "C" void -syslog (int priority, const char *message, ...) +vsyslog (int priority, const char *message, va_list ap) { debug_printf ("%x %s", priority, message); /* If the priority fails the current mask, reject */ @@ -281,8 +280,6 @@ syslog (int priority, const char *message, ...) output, then do it again to a malloc'ed string. This is ugly, slow, but prevents core dumps :-). */ - va_list ap; - pass_handler pass; for (int pass_number = 0; pass_number < 2; ++pass_number) { @@ -341,10 +338,8 @@ syslog (int priority, const char *message, ...) } /* Print out the variable part */ - va_start (ap, message); if (pass.print_va (message, ap) == -1) return; - va_end (ap); } const char *msg_strings[1]; @@ -409,6 +404,15 @@ syslog (int priority, const char *message, ...) } extern "C" void +syslog (int priority, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + vsyslog (priority, message, ap); + va_end (ap); +} + +extern "C" void closelog (void) { ; |