From: Richard Levitte Date: Mon, 24 Jan 2000 04:05:00 +0000 (+0000) Subject: Add the PID to the output on Win32. X-Git-Tag: OpenSSL_0_9_5beta1~202 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=baf32381b50c23d3fb0f884f9e1656debbf5023c;ds=sidebyside Add the PID to the output on Win32. --- diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index db82e757e7..497c8aee61 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -72,6 +72,8 @@ #else #include #endif +#else +#include #endif #include "cryptlib.h" @@ -131,8 +133,11 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) char* buf= in; char* pp; #if defined(WIN32) - LPTSTR lpszStrings[1]; + LPTSTR lpszStrings[2]; WORD evtype= EVENTLOG_ERROR_TYPE; + int pid = _getpid(); + char pidbuf[20]; + int pidbufl; #else int priority; #endif @@ -156,10 +161,13 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) evtype= EVENTLOG_ERROR_TYPE; pp= buf; } - lpszStrings[0]= pp; + + sprintf(pidbuf, "[%d] ", pid); + lpszStrings[0] = pidbuf; + lpszStrings[1] = pp; if(b->ptr) - ReportEvent(b->ptr, evtype, 0, 1024, NULL, 1, 0, + ReportEvent(b->ptr, evtype, 0, 1024, NULL, 2, 0, lpszStrings, NULL); #else if(strncmp(buf, "ERR ", 4) == 0){