X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbio%2Fbss_log.c;h=4308b196633630e72eb35188416770a295107ca2;hb=8d5b4ee1cab7cd02f9fe246fb60d7d018a315a86;hp=b89e6e09e1a1cfdd7f4f8880fa9cb12d4edf7654;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd;p=oweals%2Fopenssl.git diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index b89e6e09e1..4308b19663 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -67,29 +67,26 @@ #include #ifndef WIN32 +#ifdef __ultrix +#include +#else #include #endif +#else +#include +#endif #include "cryptlib.h" -#include "buffer.h" -#include "err.h" +#include +#include #ifndef NO_SYSLOG -#ifndef NOPROTO static int MS_CALLBACK slg_write(BIO *h,char *buf,int num); static int MS_CALLBACK slg_puts(BIO *h,char *str); static long MS_CALLBACK slg_ctrl(BIO *h,int cmd,long arg1,char *arg2); static int MS_CALLBACK slg_new(BIO *h); static int MS_CALLBACK slg_free(BIO *data); -#else -static int MS_CALLBACK slg_write(); -static int MS_CALLBACK slg_puts(); -static long MS_CALLBACK slg_ctrl(); -static int MS_CALLBACK slg_new(); -static int MS_CALLBACK slg_free(); -#endif - static int xopenlog(BIO* bp, const char* name, int level); static int xcloselog(BIO* bp); @@ -103,6 +100,7 @@ static BIO_METHOD methods_slg= slg_ctrl, slg_new, slg_free, + NULL, }; BIO_METHOD *BIO_s_log(void) @@ -136,8 +134,10 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) char* buf= in; char* pp; #if defined(WIN32) - LPTSTR lpszStrings[1]; + LPCSTR lpszStrings[2]; WORD evtype= EVENTLOG_ERROR_TYPE; + int pid = _getpid(); + char pidbuf[20]; #else int priority; #endif @@ -161,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){