Do what the SDK documentation tells.
This commit is contained in:
parent
107448698f
commit
46cfe61994
1 changed files with 5 additions and 4 deletions
|
@ -17,7 +17,7 @@
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id: logger.c,v 1.1.2.10 2003/08/17 09:04:00 guus Exp $
|
$Id: logger.c,v 1.1.2.11 2003/08/17 12:04:35 guus Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
@ -51,7 +51,7 @@ void openlogger(const char *ident, logmode_t mode) {
|
||||||
break;
|
break;
|
||||||
case LOGMODE_SYSLOG:
|
case LOGMODE_SYSLOG:
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
loghandle = OpenEventLog(NULL, identname);
|
loghandle = RegisterEventSource(NULL, logident);
|
||||||
if(!loghandle)
|
if(!loghandle)
|
||||||
logmode = LOGMODE_NULL;
|
logmode = LOGMODE_NULL;
|
||||||
break;
|
break;
|
||||||
|
@ -87,8 +87,9 @@ void logger(int priority, const char *format, ...) {
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
{
|
{
|
||||||
char message[4096];
|
char message[4096];
|
||||||
|
char *messages[] = {message};
|
||||||
vsnprintf(message, sizeof(message), format, ap);
|
vsnprintf(message, sizeof(message), format, ap);
|
||||||
ReportEvent(loghandle, priority, 0, 0, NULL, 1, 0, &message, NULL);
|
ReportEvent(loghandle, priority, 0, 0, NULL, 1, 0, messages, NULL);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SYSLOG_H
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
@ -118,7 +119,7 @@ void closelogger(void) {
|
||||||
break;
|
break;
|
||||||
case LOGMODE_SYSLOG:
|
case LOGMODE_SYSLOG:
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
CloseEventLog(loghandle);
|
DeregisterEventSource(loghandle);
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SYSLOG_H
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
|
Loading…
Reference in a new issue