From be7a0be8166b749dd34e5c3a5a13e8e52a0ec7d3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 3 May 2012 12:05:52 -0400 Subject: [PATCH 1/2] Fix win32 build issues: sleep, pid_t --- test/regress.c | 4 ++++ test/regress.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/test/regress.c b/test/regress.c index b2f70c41..25d9a884 100644 --- a/test/regress.c +++ b/test/regress.c @@ -878,7 +878,11 @@ test_fork(void) } /* wait for the child to read the data */ +#ifdef _WIN32 + Sleep(1000); +#else sleep(1); +#endif if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) { tt_fail_perror("write"); diff --git a/test/regress.h b/test/regress.h index afcc35fc..78dc3d01 100644 --- a/test/regress.h +++ b/test/regress.h @@ -118,7 +118,9 @@ int _test_ai_eq(const struct evutil_addrinfo *ai, const char *sockaddr_port, long timeval_msec_diff(const struct timeval *start, const struct timeval *end); +#ifndef _WIN32 pid_t regress_fork(void); +#endif #ifdef __cplusplus } From e06206ebd8e799f75258e66e6eb391436481ee56 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 3 May 2012 12:15:11 -0400 Subject: [PATCH 2/2] Oops; fix the *right* windows compile issue --- test/regress.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/regress.c b/test/regress.c index 25d9a884..65921420 100644 --- a/test/regress.c +++ b/test/regress.c @@ -639,7 +639,11 @@ test_persistent_timeout_jump(void *ptr) event_assign(&ev, data->base, -1, EV_PERSIST, periodic_timeout_cb, &count); event_add(&ev, &msec100); /* Wait for a bit */ +#ifdef _WIN32 + Sleep(1000); +#else sleep(1); +#endif event_base_loopexit(data->base, &msec50); event_base_dispatch(data->base); tt_int_op(count, ==, 1); @@ -878,11 +882,7 @@ test_fork(void) } /* wait for the child to read the data */ -#ifdef _WIN32 - Sleep(1000); -#else sleep(1); -#endif if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) { tt_fail_perror("write");