mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Fix bench_cascade program on Windows.
This commit is contained in:
parent
9bbce0b63c
commit
78da644f3d
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user