Fix to build better with DJGPP.
[openssl.git] / crypto / bio / bss_log.c
index bdcbf30480d5023567a029b8c38c3f8415184f63..534181267216418ee238c17ef41e9192bedc7ab3 100644 (file)
@@ -66,7 +66,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include <openssl/e_os2.h>
+#include "cryptlib.h"
 
 #if defined(OPENSSL_SYS_WIN32)
 #  include <process.h>
 #  include <starlet.h>
 #elif defined(__ultrix)
 #  include <sys/syslog.h>
-#elif !defined(MSDOS) && !defined(NO_SYSLOG) /* Unix */
+#elif (!defined(MSDOS) || defined(WATT32)) && !defined(OPENSSL_SYS_VXWORKS) && !defined(NO_SYSLOG)
 #  include <syslog.h>
 #endif
 
-#include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/err.h>
 
@@ -275,7 +274,7 @@ static void xsyslog(BIO *bp, int priority, const char *string)
        LPCSTR lpszStrings[2];
        WORD evtype= EVENTLOG_ERROR_TYPE;
        int pid = _getpid();
-       char pidbuf[20];
+       char pidbuf[DECIMAL_SIZE(pid)+4];
 
        switch (priority)
                {
@@ -374,11 +373,15 @@ static void xcloselog(BIO* bp)
 {
 }
 
-#else /* Unix */
+#else /* Unix/Watt32 */
 
 static void xopenlog(BIO* bp, char* name, int level)
 {
+#ifdef WATT32   /* djgpp/DOS */
+       openlog(name, LOG_PID|LOG_CONS|LOG_NDELAY, level);
+#else
        openlog(name, LOG_PID|LOG_CONS, level);
+#endif
 }
 
 static void xsyslog(BIO *bp, int priority, const char *string)