Add the PID to the output on Win32.
This commit is contained in:
parent
1675f6eb05
commit
baf32381b5
@ -72,6 +72,8 @@
|
|||||||
#else
|
#else
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#include <process.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
@ -131,8 +133,11 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
|
|||||||
char* buf= in;
|
char* buf= in;
|
||||||
char* pp;
|
char* pp;
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
LPTSTR lpszStrings[1];
|
LPTSTR lpszStrings[2];
|
||||||
WORD evtype= EVENTLOG_ERROR_TYPE;
|
WORD evtype= EVENTLOG_ERROR_TYPE;
|
||||||
|
int pid = _getpid();
|
||||||
|
char pidbuf[20];
|
||||||
|
int pidbufl;
|
||||||
#else
|
#else
|
||||||
int priority;
|
int priority;
|
||||||
#endif
|
#endif
|
||||||
@ -156,10 +161,13 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
|
|||||||
evtype= EVENTLOG_ERROR_TYPE;
|
evtype= EVENTLOG_ERROR_TYPE;
|
||||||
pp= buf;
|
pp= buf;
|
||||||
}
|
}
|
||||||
lpszStrings[0]= pp;
|
|
||||||
|
sprintf(pidbuf, "[%d] ", pid);
|
||||||
|
lpszStrings[0] = pidbuf;
|
||||||
|
lpszStrings[1] = pp;
|
||||||
|
|
||||||
if(b->ptr)
|
if(b->ptr)
|
||||||
ReportEvent(b->ptr, evtype, 0, 1024, NULL, 1, 0,
|
ReportEvent(b->ptr, evtype, 0, 1024, NULL, 2, 0,
|
||||||
lpszStrings, NULL);
|
lpszStrings, NULL);
|
||||||
#else
|
#else
|
||||||
if(strncmp(buf, "ERR ", 4) == 0){
|
if(strncmp(buf, "ERR ", 4) == 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user