summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-11-13 11:22:21 +0000
committerMatt Caswell <matt@openssl.org>2015-11-20 23:37:17 +0000
commit2b2c78d4f0a73498739cfc0879299d7325c35160 (patch)
tree2ed0601fe6fa8482bca8646a8cc0b290386e48f4 /include
parente38565f536b7674ef507564b5c646712b1d7eed4 (diff)
Swap to using proper windows pipes
We were using _pipe to create a pipe on windows. This uses the "int" type for its file descriptor for compatibility. However most windows functions expect to use a "HANDLE". Probably we could get away with just casting but it seems more robust to use the proper type and main stream windows functions. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'include')
-rw-r--r--include/openssl/async.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/openssl/async.h b/include/openssl/async.h
index 6e7cf72b0b..0cfd7dc683 100644
--- a/include/openssl/async.h
+++ b/include/openssl/async.h
@@ -56,6 +56,14 @@
#include <stdlib.h>
+#if defined(_WIN32) || defined(__CYGWIN__)
+#include <windows.h>
+#define OSSL_ASYNC_FD HANDLE
+#else
+#define OSSL_ASYNC_FD int
+#endif
+
+
# ifdef __cplusplus
extern "C" {
# endif
@@ -74,7 +82,7 @@ int ASYNC_start_job(ASYNC_JOB **job, int *ret, int (*func)(void *),
void *args, size_t size);
int ASYNC_pause_job(void);
-int ASYNC_get_wait_fd(ASYNC_JOB *job);
+OSSL_ASYNC_FD ASYNC_get_wait_fd(ASYNC_JOB *job);
ASYNC_JOB *ASYNC_get_current_job(void);
void ASYNC_wake(ASYNC_JOB *job);
void ASYNC_clear_wake(ASYNC_JOB *job);