PR: 2192
[openssl.git] / engines / e_aep.c
index 7307ddfafb5b4aeb9668de15afdbf9904b332778..742b4f9b186dea01a64567568781fa4dec93aecb 100644 (file)
@@ -57,7 +57,7 @@
 #include <string.h>
 
 #include <openssl/e_os2.h>
-#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
+#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__) || defined(__MINGW32__)
 #include <sys/types.h>
 #include <unistd.h>
 #else
 typedef int pid_t;
 #endif
 
+#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB)
+#define getpid GetThreadID
+extern int GetThreadID(void);
+#endif
+
 #include <openssl/crypto.h>
 #include <openssl/dso.h>
 #include <openssl/engine.h>
@@ -862,10 +867,12 @@ static AEP_RV aep_get_connection(AEP_CONNECTION_HNDL_PTR phConnection)
 
        CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 
-#ifndef NETWARE_CLIB
-       curr_pid = getpid();
-#else
+#ifdef NETWARE_CLIB
        curr_pid = GetThreadID();
+#elif defined(_WIN32)
+       curr_pid = _getpid();
+#else
+       curr_pid = getpid();
 #endif
 
        /*Check if this is the first time this is being called from the current