diff options
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/or/test.c b/src/or/test.c index 881396c55f..acc3896afd 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -3,7 +3,14 @@ /* $Id$ */ #include <stdio.h> +#ifdef HAVE_FCNTL_H #include <fcntl.h> +#endif + +#ifdef _MSC_VER +/* For mkdir() */ +#include <direct.h> +#endif #include "or.h" #include "../common/test.h" @@ -26,8 +33,14 @@ dump_hex(char *s, int len) void setup_directory() { char buf[256]; + int r; sprintf(buf, "/tmp/tor_test"); - if (mkdir(buf, 0700) && errno != EEXIST) +#ifdef _MSC_VER + r = mkdir(buf); +#else + r = mkdir(buf, 0700); +#endif + if (r && errno != EEXIST) fprintf(stderr, "Can't create directory %s", buf); } |