IP_ADDR_STRING *ns;
GetNetworkParams_fn_t fn;
- ASSERT_LOCKD(base);
+ ASSERT_LOCKED(base);
if (!(handle = LoadLibrary("iphlpapi.dll"))) {
log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll");
status = -1;
*/
#include <sys/types.h>
+#ifdef WIN32
+#include <winsock2.h>
+#else
#include <sys/socket.h>
#include <netinet/in.h>
+#endif
#include <stdlib.h>
#include <errno.h>
#include <event2/buffer.h>
#include <event2/util.h>
+/* for EVUTIL_ERR_CONNECT_RETRIABLE macro */
+#include "util-internal.h"
+
const char *resource = NULL;
struct event_base *base = NULL;
{
struct linger l;
int one = 1;
- setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one));
l.l_onoff = 1;
l.l_linger = 0;
- if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &l, sizeof(l))<0)
+ if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
perror("setsockopt");
}
return -1;
frob_socket(sock);
if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) < 0) {
- if (errno != EINTR && errno != EINPROGRESS) {
+ int e = errno;
+ if (! EVUTIL_ERR_CONNECT_RETRIABLE(e)) {
return -1;
}
}
static void
set_random_timeout(struct event *ev)
{
- ev->ev_timeout.tv_sec = random();
- ev->ev_timeout.tv_usec = random();
+ ev->ev_timeout.tv_sec = rand();
+ ev->ev_timeout.tv_usec = rand();
ev->min_heap_idx = -1;
}
*/
int ok;
char buffer[LONGEST_TEST_NAME+256];
- const char *verbosity;
+ //const char *verbosity;
STARTUPINFO si;
PROCESS_INFORMATION info;
DWORD exitcode;