From 78da644f3d88a4770d10e5a55c1fda17085b716b Mon Sep 17 00:00:00 2001 From: Joakim Soderberg Date: Mon, 16 Dec 2013 11:35:31 +0100 Subject: [PATCH] Fix bench_cascade program on Windows. --- test/bench_cascade.c | 9 +++++++++ test/bench_http.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/test/bench_cascade.c b/test/bench_cascade.c index 5bb155b1..d14af82b 100644 --- a/test/bench_cascade.c +++ b/test/bench_cascade.c @@ -146,6 +146,11 @@ main(int argc, char **argv) struct timeval *tv; int num_pipes = 100; +#ifdef WIN32 + WSADATA WSAData; + WSAStartup(0x101, &WSAData); +#endif + while ((c = getopt(argc, argv, "n:")) != -1) { switch (c) { case 'n': @@ -175,5 +180,9 @@ main(int argc, char **argv) tv->tv_sec * 1000000L + tv->tv_usec); } +#ifdef WIN32 + WSACleanup(); +#endif + exit(0); } diff --git a/test/bench_http.c b/test/bench_http.c index 09f521b5..c031f70f 100644 --- a/test/bench_http.c +++ b/test/bench_http.c @@ -184,6 +184,10 @@ main(int argc, char **argv) } event_base_dispatch(base); +#ifdef WIN32 + WSACleanup(); +#endif + /* NOTREACHED */ return (0); }