Fix bench_cascade program on Windows.

This commit is contained in:
Joakim Soderberg 2013-12-16 11:35:31 +01:00
parent 9bbce0b63c
commit 78da644f3d
2 changed files with 13 additions and 0 deletions

View File

@ -146,6 +146,11 @@ main(int argc, char **argv)
struct timeval *tv; struct timeval *tv;
int num_pipes = 100; int num_pipes = 100;
#ifdef WIN32
WSADATA WSAData;
WSAStartup(0x101, &WSAData);
#endif
while ((c = getopt(argc, argv, "n:")) != -1) { while ((c = getopt(argc, argv, "n:")) != -1) {
switch (c) { switch (c) {
case 'n': case 'n':
@ -175,5 +180,9 @@ main(int argc, char **argv)
tv->tv_sec * 1000000L + tv->tv_usec); tv->tv_sec * 1000000L + tv->tv_usec);
} }
#ifdef WIN32
WSACleanup();
#endif
exit(0); exit(0);
} }

View File

@ -184,6 +184,10 @@ main(int argc, char **argv)
} }
event_base_dispatch(base); event_base_dispatch(base);
#ifdef WIN32
WSACleanup();
#endif
/* NOTREACHED */ /* NOTREACHED */
return (0); return (0);
} }