summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bss_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bss_log.c')
-rw-r--r--src/lib/libcrypto/bio/bss_log.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c
index db82e757e7..4308b19663 100644
--- a/src/lib/libcrypto/bio/bss_log.c
+++ b/src/lib/libcrypto/bio/bss_log.c
@@ -72,6 +72,8 @@
72#else 72#else
73#include <syslog.h> 73#include <syslog.h>
74#endif 74#endif
75#else
76#include <process.h>
75#endif 77#endif
76 78
77#include "cryptlib.h" 79#include "cryptlib.h"
@@ -98,6 +100,7 @@ static BIO_METHOD methods_slg=
98 slg_ctrl, 100 slg_ctrl,
99 slg_new, 101 slg_new,
100 slg_free, 102 slg_free,
103 NULL,
101 }; 104 };
102 105
103BIO_METHOD *BIO_s_log(void) 106BIO_METHOD *BIO_s_log(void)
@@ -131,8 +134,10 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
131 char* buf= in; 134 char* buf= in;
132 char* pp; 135 char* pp;
133#if defined(WIN32) 136#if defined(WIN32)
134 LPTSTR lpszStrings[1]; 137 LPCSTR lpszStrings[2];
135 WORD evtype= EVENTLOG_ERROR_TYPE; 138 WORD evtype= EVENTLOG_ERROR_TYPE;
139 int pid = _getpid();
140 char pidbuf[20];
136#else 141#else
137 int priority; 142 int priority;
138#endif 143#endif
@@ -156,10 +161,13 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
156 evtype= EVENTLOG_ERROR_TYPE; 161 evtype= EVENTLOG_ERROR_TYPE;
157 pp= buf; 162 pp= buf;
158 } 163 }
159 lpszStrings[0]= pp; 164
165 sprintf(pidbuf, "[%d] ", pid);
166 lpszStrings[0] = pidbuf;
167 lpszStrings[1] = pp;
160 168
161 if(b->ptr) 169 if(b->ptr)
162 ReportEvent(b->ptr, evtype, 0, 1024, NULL, 1, 0, 170 ReportEvent(b->ptr, evtype, 0, 1024, NULL, 2, 0,
163 lpszStrings, NULL); 171 lpszStrings, NULL);
164#else 172#else
165 if(strncmp(buf, "ERR ", 4) == 0){ 173 if(strncmp(buf, "ERR ", 4) == 0){